```c# public class TimeHelper { private long _start, _stop, _elapsed; /// /// 獲取初始時間戳 /// public void start() { _start = Stopwatch.GetTimestamp(); } /... ...
public class TimeHelper
{
private long _start, _stop, _elapsed;
/// <summary>
/// 獲取初始時間戳
/// </summary>
public void start()
{
_start = Stopwatch.GetTimestamp();
}
/// <summary>
/// 獲取終結時間戳
/// </summary>
public void stop()
{
_stop = Stopwatch.GetTimestamp();
}
/// <summary>
/// 獲取高精度時間間隔
/// </summary>
/// <returns></returns>
public double getTimeInteval()
{
return (_stop - _start) * (1.0 / Stopwatch.Frequency);
}
}