24 lines
572 B
VB.net
24 lines
572 B
VB.net
Public Class Watch
|
|
|
|
Private ReadOnly _StopWatch As Stopwatch
|
|
Private ReadOnly _Name As String
|
|
|
|
Public Sub New(pName As String)
|
|
_StopWatch = New Stopwatch()
|
|
_StopWatch.Start()
|
|
|
|
_Name = pName
|
|
Debug.WriteLine($"Starting [{pName}].")
|
|
End Sub
|
|
|
|
Public Sub Restart()
|
|
_StopWatch.Restart()
|
|
Debug.WriteLine($"Starting [{_Name}].")
|
|
End Sub
|
|
|
|
Public Sub [Stop]()
|
|
_StopWatch.Stop()
|
|
Debug.WriteLine($"Stopped [{_Name}] after {_StopWatch.Elapsed.TotalSeconds} seconds.")
|
|
End Sub
|
|
End Class
|