Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function KevinTimer2()
' Kevin (3StarLounger) 01/03/14 22:29
' Code: A better elapsed time [Post#: 23626 ]
' Remember I found the "ms" format for the Format() statement? Well, I've never been convinced that it really displays the actual
' milliseconds part of the time. Not sure if I read something somewhere or what.
' Anyway, a simple Windows API call is reliable and too easy to use:
    Dim TimeStart As Long
    Dim TimeElapsed As Long
    TimeStart = GetTickCount
'''    Dim i, J, K
'''    For i = 1 To 100
'''        For J = 1 To 100
'''            For K = 1 To 100
'''            Next K
'''        Next J
'''    Next i
    TimeElapsed = GetTickCount - TimeStart
Debug.Print "Elapsed time = " & CStr(TimeElapsed / 1000) & " seconds."
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function KevinTimer2()
' Kevin (3StarLounger) 01/03/14 22:29
' Code: A better elapsed time [Post#: 23626 ]
' Remember I found the "ms" format for the Format() statement? Well, I've never been convinced that it really displays the actual
' milliseconds part of the time. Not sure if I read something somewhere or what.
' Anyway, a simple Windows API call is reliable and too easy to use:
    Dim TimeStart As Long
    Dim TimeElapsed As Long
    TimeStart = GetTickCount
'''    Dim i, J, K
'''    For i = 1 To 100
'''        For J = 1 To 100
'''            For K = 1 To 100
'''            Next K
'''        Next J
'''    Next i
    TimeElapsed = GetTickCount - TimeStart
Debug.Print "Elapsed time = " & CStr(TimeElapsed / 1000) & " seconds."
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1