|
-
Oct 23rd, 2001, 02:20 PM
#1
Thread Starter
Hyperactive Member
Using SetSystemTime
How would I design an operation that stores the current time to the millisecond, then changes the current time to some other time accurate to a millisecond, and then when it is done, restores the time when the operation started(i.e the storage of the currrent time). Thank you for your help.
Sincerely,
Joseph
-
Oct 23rd, 2001, 02:40 PM
#2
To get the current time in milliseconds try
VB Code:
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Function TimeToMillisecond() As String
Dim DaAnswer As String
Dim MyMillTime As SYSTEMTIME
On Error Resume Next
GetSystemTime MyMillTime
DaAnswer = Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & ":" & MyMillTime.wMilliseconds
TimeToMillisecond = DaAnswer
End Function
I'm a little confused after this however. ??You want to get the current time in milliseconds, convert it to "something else" and then convert is back??
-
Oct 23rd, 2001, 02:48 PM
#3
Thread Starter
Hyperactive Member
maybe this will clarify
I want to get the current time(store it in currenttime). Then, I want to set the time to some predefined time(set the time to newtime). Then after I execute some code I want to set the time back to currenttime(the value stored earlier). Thanks for the help
Joe
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
|