Language: Add new Watch class
This commit is contained in:
parent
d0e4ecb4ed
commit
cd24795a0b
@ -90,6 +90,7 @@
|
|||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Watch.vb" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="My Project\Resources.resx">
|
<EmbeddedResource Include="My Project\Resources.resx">
|
||||||
|
|||||||
23
Modules.Language/Watch.vb
Normal file
23
Modules.Language/Watch.vb
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
Loading…
x
Reference in New Issue
Block a user