PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Timer realization

Does anyone know how to implement realization high-precise timer based on GetTickCount or smth. like QueryPerformanceFrequency / QueryPerformanceCount ?

Does anyone and how it looks? :)

P.S. API SetTimer function is inaccurate, you know...
BurningSheep · 04 Nov 2002, 13:58 UTC
QueryPerformanceFrequency and QueryPerformanceCount are available on PocketPC, but from the docs I get that the OEMs don't necesseraly provide high-resolution performance counters. So you probably want to check whether it's available.
What's about PocketPC 2002 with using GetTickCount method?

Anyway, if somebody use high-resolution timer or just have an ideas how to do that... just reply somewhere. :)

P.S. Maybe it's enough for most to use API SetTimer... though. [/b]
You can use QueryPerformanceCounter, it works fine.

Regards..

Marco.
Extremely perfect suggestion. :lol:

Could you give a one tiny example? Please. :wink:
Code:

double time;
double time2;
__int64 t1,t2,freq;

void starttiming()
{
QueryPerformanceFrequency((LARGE_INTEGER *)&freq;);
QueryPerformanceCounter((LARGE_INTEGER *)&t1;);
}

void endtiming()
{
QueryPerformanceCounter((LARGE_INTEGER *)&t2;);
time=(double)(t2-t1)/(double)(freq);//time per frame
time2=(double)(freq)/(double)(t2-t1);//fps
}


Where did you lose your SDK?!?