VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Speedtest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Option Explicit

Public Sub testSpeed()
    Const dataMax = 150000
    Dim tmp As Long
    Dim s As String
    Dim c As Collection
    Dim startDate As Date
    Dim endDate As Date
    
    'Collection füllen, ohne Index
    Set c = New Collection
    startDate = Now
    For tmp = 1 To dataMax
       c.Add "Test"
    Next
    endDate = Now
    s = s & "Test: Collection erstellen, ohne Index" & vbNewLine & "Dauer: " & Format(endDate - startDate, "hh:mm:ss") & vbNewLine & vbNewLine
    
    'Collection eintragen, ohne Index
    startDate = Now
    tmp = 1
    Do While tmp <= c.Count
        ThisWorkbook.Worksheets(1).Range("A" & tmp).Value = c(tmp)
        tmp = tmp + 1
    Loop
    endDate = Now
    s = s & "Test: Werte aus Collection in Worksheet eintragen, ohne Index" & vbNewLine & "Dauer: " & Format(endDate - startDate, "hh:mm:ss") & vbNewLine & vbNewLine
    
    'Collection füllen, mit Index
    Set c = New Collection
    startDate = Now
    For tmp = 1 To dataMax
       c.Add "Test", CStr(tmp)
    Next
    endDate = Now
    s = s & "Test: Collection erstellen, mit Index" & vbNewLine & "Dauer: " & Format(endDate - startDate, "hh:mm:ss") & vbNewLine & vbNewLine
    
    'Collection eintragen, mit Index
    startDate = Now
    tmp = 1
    Do While tmp <= c.Count
        ThisWorkbook.Worksheets(1).Range("B" & tmp).Value = c(CStr(tmp))
        tmp = tmp + 1
    Loop
    endDate = Now
    s = s & "Test: Werte aus Collection in Worksheet eintragen, mit Index" & vbNewLine & "Dauer: " & Format(endDate - startDate, "hh:mm:ss") & vbNewLine & vbNewLine
    
    
    MsgBox (s)
    ThisWorkbook.Worksheets(1).Range("A1:B" & dataMax).Delete
End Sub
