|
-
Nov 22nd, 2000, 04:25 AM
#1
Thread Starter
Fanatic Member
would to requesting for a code that would monitor
time elapsed.
Any guru's willing to help?
-
Nov 22nd, 2000, 04:39 AM
#2
well ive got no idea
but could u help me out with the phone thing?
-
Nov 22nd, 2000, 05:04 AM
#3
Frenzied Member
You can use the GetTickCount API function to get the number of milliseconds since system startup. It is a long value, so it overflows and resets to 0 after (I think) about 49.7 or so days (4,294,967,296 milliseconds). Here's the declaration:
Code:
Public Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
Stick that in a module. You can time things by recording the tick count at the beginning of the process, and then subtracting that value from subsequent sample tick counts. So, in your code, you might have something like this:
Code:
Dim startTick As Long
Dim currentTick As Long
Dim interval As Long
startTick = GetTickCount
'Other code could go here if you were timing the length
'of time your code took to execute
'If you make the startTick variable global or static you
'can set it, then let the user do stuff and time their actions
currentTick = GetTickCount
interval = currentTick - startTick
MsgBox "Time = " & interval & " milliseconds."
Alternatively, you can get Windows to run a timer for you, using the SetTimer and KillTimer functions. You'll have to look that up in the help though, because I only really know how to do that in C.
Hope that helps some
Harry.
"From one thing, know ten thousand things."
-
Nov 22nd, 2000, 11:38 PM
#4
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|