mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
Adding Restart method to IcdStopwatch
This commit is contained in:
parent
1807892d75
commit
f7cd51d3df
1 changed files with 18 additions and 1 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -47,21 +46,39 @@ namespace ICD.Common.Utils.Timers
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops the stopwatch at the current elapsed time.
|
||||||
|
/// </summary>
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
m_Stopwatch.Stop();
|
m_Stopwatch.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts or resumes the stopwatch from the current elapsed time.
|
||||||
|
/// </summary>
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
m_Stopwatch.Start();
|
m_Stopwatch.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops the stopwatch and resets the elapsed time to 0.
|
||||||
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
m_Stopwatch.Reset();
|
m_Stopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the stopwatch and starts again from an elapsed time of 0.
|
||||||
|
/// </summary>
|
||||||
|
public void Restart()
|
||||||
|
{
|
||||||
|
Reset();
|
||||||
|
Start();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue