goatsaregreat
Programmer
I need to create a stopwatch in the minutes:seconds.tenths,hundreths (00:00.00) format. I use a timer to control this, but the timer will not go fast enough to count hundreths of seconds. Someone suggested the following code to me, but it is the same result.
Option Explicit
'
' timer1.interval = 10
'
Dim lngTime As Long
Dim blStarted As Boolean
Private Sub Command1_Click()
lngTime = 0
blStarted = True
Text1 = "00:00:00"
End Sub
Private Sub Command2_Click()
blStarted = False
End Sub
Private Sub Timer1_Timer()
Dim lngMin As Long, lngSec As Long, lngHund As Long
If blStarted Then
lngTime = lngTime + 1
lngSec = Int(lngTime / 1000)
lngHund = lngTime Mod 100
lngMin = Int(lngSec / 600)
lngSec = lngSec Mod 60
Text1 = Format(lngMin, "00"
& ":" & Format(lngSec, "00"
& ":" & Format(lngHund, "00"
End If
End Sub
I have put the timer interval at "1" with no change. It still is not fast enough. TIA for your help.
Option Explicit
'
' timer1.interval = 10
'
Dim lngTime As Long
Dim blStarted As Boolean
Private Sub Command1_Click()
lngTime = 0
blStarted = True
Text1 = "00:00:00"
End Sub
Private Sub Command2_Click()
blStarted = False
End Sub
Private Sub Timer1_Timer()
Dim lngMin As Long, lngSec As Long, lngHund As Long
If blStarted Then
lngTime = lngTime + 1
lngSec = Int(lngTime / 1000)
lngHund = lngTime Mod 100
lngMin = Int(lngSec / 600)
lngSec = lngSec Mod 60
Text1 = Format(lngMin, "00"
End If
End Sub
I have put the timer interval at "1" with no change. It still is not fast enough. TIA for your help.