Hi! I need to make a timer that counts in hours, minutes and seconds and not only pulses.
Is there any way to do it??
Thank You!!!!
Printable View
Hi! I need to make a timer that counts in hours, minutes and seconds and not only pulses.
Is there any way to do it??
Thank You!!!!
this is what I would do:
set the interval to 6000Code:Dim intTimer As Currency
Private Sub Timer1_Timer()
If intTimer = numberofseconds Then
MsgBox "The time has been reached"
Else:
intTimer = intTimer + 1
End If
End Sub
replace numberofseconds with the number of seconds that you want,
1 minute = 60 seconds
1 hour = 3600 seconds
[Edited by dimava on 09-16-2000 at 11:09 PM]
Try the following:
Usage:Code:Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim StopTime As Boolean
Sub TimerEx(Interval As Long)
Do While StopTime = True
Start = GetTickCount
Do While Start + Interval > GetTickCount
DoEvents
Loop
Print "1 Second"
Loop
End Sub
Code:Private Sub Command1_Click()
'Start the Timer at intervals of 1000ms (1 second)
'1 min = 60000 and 1 hour = 3600000
StopTime = True
TimerEx 1000
End Sub
Private Sub Command2_Click()
'Stop the Timer
StopTime = False
End Sub