using System;
namespace Robust.Shared.Timing
{
///
/// Provides a set of methods and properties that you can use to accurately
/// measure elapsed time.
///
public sealed class Stopwatch : IStopwatch
{
private readonly System.Diagnostics.Stopwatch _stopwatch;
///
/// Constructs a new instance of this object.
///
public Stopwatch()
{
_stopwatch = new System.Diagnostics.Stopwatch();
}
///
/// Gets the total elapsed time measured by the current instance.
///
public TimeSpan Elapsed => _stopwatch.Elapsed;
///
/// Starts, or resumes, measuring elapsed time for an interval.
///
public void Start()
{
_stopwatch.Start();
}
///
/// Stops time interval measurement, resets the elapsed time to zero,
/// and starts measuring elapsed time.
///
public void Restart()
{
_stopwatch.Restart();
}
}
}