using System.Diagnostics;
|
|
namespace SA_LTT
|
{
|
public class SequenceTimer
|
{
|
#region Property
|
public double Seconds
|
{
|
get
|
{
|
return _stopwatch.Elapsed.TotalSeconds;
|
}
|
}
|
|
public double Minute
|
{
|
get
|
{
|
return _stopwatch.Elapsed.TotalMinutes;
|
}
|
}
|
#endregion
|
|
#region Field
|
private Stopwatch _stopwatch;
|
#endregion
|
|
#region Construct
|
public SequenceTimer()
|
{
|
_stopwatch = new Stopwatch();
|
}
|
#endregion
|
|
#region Fuction
|
public void Start()
|
{
|
if (_stopwatch.IsRunning == false)
|
{
|
_stopwatch.Start();
|
}
|
}
|
|
public void ReStart()
|
{
|
_stopwatch.Restart();
|
}
|
|
public void Stop()
|
{
|
if (_stopwatch.IsRunning == true)
|
{
|
_stopwatch.Stop();
|
}
|
}
|
|
public void Reset()
|
{
|
_stopwatch.Reset();
|
}
|
#endregion
|
}
|
}
|