示例#1
0
        public HighPerformanceTimer()
        {
            startTime = stopTime = duration = freq = 0;

            if (!DllImports.QueryPerformanceFrequency(out freq))
            {
                throw new NotSupportedException("HighPerformanceTimer");
            }
        }
示例#2
0
 public void Continue()
 {
     DllImports.QueryPerformanceCounter(out startTime);
 }
示例#3
0
 public void Pause()
 {
     DllImports.QueryPerformanceCounter(out stopTime);
     duration += stopTime - startTime;
 }
示例#4
0
 public void Start()
 {
     DllImports.QueryPerformanceCounter(out startTime);
     duration = 0;
 }