Timer in VB

I am using Timer function in VB6 to record the time. However, Timer counts the number of seconds elapsed since midnight, but is there a way to reset the Timer function value to zero at anytime of the day (without changing the system time)?
LVL 1
khaledcAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Erick37Connect With a Mentor Commented:
Use the Now function to get the current time.  Store the value in a global variable when you want to start recording time.  Elapsed time can be derived by subtracting Now from the Start time.

StartTime = Now 'Assign the current time to a global variable

ElapsedTime = Now - StartTime 'Elapsed time since StartTime was initialized

Caption = Format(ElapsedTime, "hh:nn:ss")
0
 
WatsonRCommented:
..or, if you need a greater level of supposed accuracy, try the same approach but with the GetTickCount API routine.

Ross
0
All Courses

From novice to tech pro — start learning today.