VB Code:
'Declarations
Private tim1 As DateTime
Private tim2 As DateTime
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
tim1 = Now() ' current time
TextBox1.Text = tim1.ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim timeDifference As TimeSpan
tim2 = Now() ' current time
'Get the difference between the 2 times
timeDifference = tim2.Subtract(tim1)
TextBox2.Text = tim2.ToString
'Display the difference
TextBox3.Text = "Hours : " & timeDifference.Hours.ToString & vbCrLf & "Minutes: " & timeDifference.Minutes.ToString
End Sub