PocketMatrix forums

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

Getting the Milliseconds from the clock

Is there any way to get the current milliseconds from the clock on the ppc?
BurningSheep · 09 Jul 2002, 17:11 UTC
hehe, since I've got nothing better to do at the moment anyway, GetTickCount() returns the number of milliseconds since the device was started...

work is kinda slow :D
:-) Thanks.
If you are using PocketFrog, you should use the PocketPC::GetTime() method instead.

This will work reliably on both PocketPC and desktop PC, which is not the case of GetTickCount().
BurningSheep · 09 Jul 2002, 17:59 UTC
you sure? well probably you are since you wrote PocketFrog :D but I don't seem to have a PocketPC::GetTime() method and haven't had any problems with GetTickCount()
GetTickCount() can have any resolution in Windows NT (i.e.: the resolution is NOT 1 ms).

You want to use timeGetTime() on the desktop PC and GetTickCount() on the Pocket PC. That's why there is a method to retrieve the time in PocketFrog.

Not exactly sure about the name anymore, it might be something different then GetTime(). In any case, it will be in class PocketPC and will have an obvious name.
BurningSheep · 09 Jul 2002, 18:41 UTC
ah, ok good to know, I've looked into the code

Code:

// timeGetTime() has better precision then GetTickCount() on PC
inline uint32_t PocketPC::GetTickCount()
{
#if defined(_WIN32_WCE)
return ::GetTickCount();
#else
return ::timeGetTime();
#endif
}

so you'll want to call PocketPC::GetTickCount() instead of just GetTickCount() (what I was doing)