SDRSharper/SDRSharper.Radio/SDRSharp.Radio/Counter.cs

27 lines
404 B
C#
Raw Permalink Normal View History

using System.Diagnostics;
namespace SDRSharp.Radio
{
public class Counter : Stopwatch
{
private int _count;
public long Elaps(int init)
{
if (--this._count > 0)
{
return 0L;
}
if (init != 0)
{
base.Stop();
}
long elapsedMilliseconds = base.ElapsedMilliseconds;
this._count = init;
base.Reset();
base.Start();
return elapsedMilliseconds / init;
}
}
}