Private Sub cmdGo_Click()
Dim start_time As Date
Dim stop_time As Date
Dim i As Long
Dim max_value As Long
lblDays.Caption = ""
lblHours.Caption = ""
lblMinutes.Caption = ""
lblSeconds.Caption = ""
max_value = CLng(txtCountTo.Text)
Screen.MousePointer = vbHourglass
DoEvents
start_time = Date + Time
For i = 1 To max_value
' Do nothing.
Next i
stop_time = Date + Time
lblDays.Caption = Format$(DateDiff("d", start_time, _
stop_time))
lblHours.Caption = Format$(DateDiff("h", start_time, _
stop_time))
lblMinutes.Caption = Format$(DateDiff("m", start_time, _
stop_time))
lblSeconds.Caption = Format$(DateDiff("s", start_time, _
stop_time))
Screen.MousePointer = vbDefault
End Sub
|