00001 #include "HiResTimer.h" 00002 00003 HiResTimer::HiResTimer() 00004 { 00005 QueryPerformanceFrequency((LARGE_INTEGER *)&timer_freq); 00006 QueryPerformanceCounter((LARGE_INTEGER *)¤t_time); 00007 last_time = current_time;// / timer_freq; 00008 } 00009 00010 void HiResTimer::Init() 00011 { 00012 QueryPerformanceFrequency((LARGE_INTEGER *)&timer_freq); 00013 QueryPerformanceCounter((LARGE_INTEGER *)¤t_time); 00014 last_time = current_time;// / timer_freq; 00015 } 00016 float HiResTimer::GetElapsedSeconds() 00017 { 00018 QueryPerformanceCounter((LARGE_INTEGER *)¤t_time); 00019 // current_time /= timer_freq; 00020 difference_time = float(current_time - last_time) / float(timer_freq); 00021 last_time = current_time; 00022 return difference_time; 00023 }
1.4.1