Public Class Tester
Public Shared Sub Main
Dim testWatch As New System.Diagnostics.Stopwatch
Dim results As String
' ----- Start counting.
testWatch.Start()
MsgBox("Press OK to see elapsed seconds")
' ----- Stop and record.
results = String.Format( _
"testWatch.Elapsed.Seconds: {0}{3}" & _
"testWatch.Elapsed.TotalSeconds: {1}{3}" & _
"testWatch.ElapsedMilliseconds / 1000: {2}", _
testWatch.Elapsed.Seconds, _
testWatch.Elapsed.TotalSeconds, _
testWatch.ElapsedMilliseconds / 1000, vbNewLine)
Console.WriteLine(results)
End Sub
End Class
|