Public Class Form1
Dim sw As New Stopwatch
Dim sec, min, totsec As Integer
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
sw.Start()
tmrSeconds.Enabled = True
End Sub
Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
sw.Stop()
tmrSeconds.Enabled = False
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
sw.Reset()
tmrSeconds.Enabled = False
sec = 0
min = 0
totsec = 0
lblSeconds.Text = "0"
End Sub
Private Sub tmrSeconds_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSeconds.Tick
Dim ts As TimeSpan = sw.Elapsed
sec = Convert.ToInt32(ts.Seconds)
min = Convert.ToInt32(ts.Minutes)
totsec = sec + min * 60
lblSeconds.Text = totsec.ToString
End Sub
End Class