Simple ElapsedTime function in hh:mm:ss format.
Simple "ElapsedTime" function in "hh:mm:ss" format.
Rate Simple ElapsedTime function in hh:mm:ss format.
(1(1 Vote))
Dim TimerB as Long
TimerB=Timer
'Get starting TIMER value
sleep 5000
debug.print ElapsedTime(TimerB)
End
End Sub
Public Function ElapsedTime(ByVal StartTimer As Long) As String
'where StartTimer is the starting TIMER value
Dim lh, lm, ls, TimerD As Long
TimerD = Int(Timer - StartTimer)
lh = Int(TimerD \ 3600)
lm = Int((TimerD - (lh * 3600)) \ 60)
ls = Int(TimerD - (lh * 3600) - lm * 60)
ElapsedTime = Right("0" + Trim(Str(lh)), 2) + ":" + Right("0" + Trim(Str(lm)), 2) + ":" + Right("0" + Trim(Str(ls)), 2)
End Function
Simple ElapsedTime function in hh:mm:ss format. Comments
No comments yet — be the first to post one!
Post a Comment