Archived

This topic is now archived and is closed to further replies.

Metzler

Timer Problem

Recommended Posts

Metzler    122
Hello, I wrote a class with my timer functions. It looks the following : LONGLONG GAME_HELPER:erf_Timer() { LONGLONG temp = 0; if (best_perf) { QueryPerformanceCounter((LARGE_INTEGER *)&temp); return temp; } else return timeGetTime(); } GAME_HELPER::GAME_HELPER() { if (QueryPerformanceFrequency((LARGE_INTEGER*)&perf_cnt)) { best_perf = true; time_scale = 1.0/perf_cnt; } else { best_perf = false; time_scale = 0.001; perf_cnt = 1000; } } The problem is, that Perf_Timer() returns 0, wenn best_perf flag is set to false. Why ?? THX for answers !

Share this post


Link to post
Share on other sites