PocketMatrix forums

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

GetTickCount() slow?

I've noticed that my programs, typically clocking themselves off the GetTickCount() function run fine on every Pocket PC (2000 or 2002), and even the Pocket PC 2000 emulator, but on the Pocket PC 2002 emulator they run 2 or more times slower...

Is this because the emulator is running slowly or is it a bug/eccentricity in the GetTickCount() function which could happen on a real device (i.e. GetTickCount doesn't reliably measure milliseconds at all...)?
Dave Johnston · 04 Jul 2003, 17:34 UTC — GetTickCount() slow?
Dave H wrote:
Is this because the emulator is running slowly or is it a bug/eccentricity in the GetTickCount() function which could happen on a real device (i.e. GetTickCount doesn't reliably measure milliseconds at all...)?


Try using timeGetTime() on the PC - this is what PocketFrog does!
GetTickCount on Windows XP has a 10 millisecond granularity.

On Windows CE, it has a 1 millisecond granularity.
On the desktop, you want to use the multimedia timer, timeGetTime(), instead of GetTickCount().
Why would MS bother to make the WinCE more accurate? (If I understand things correctly)
Sometimes, you have to accept facts for what they are instead of trying to understand them =)
It's a totally different kernel and OS architecture from the Windows versions found on the desktop. CE was designed from the ground up to be an embedded realtime OS and as such it has drastically different requirements than something running on your desktop. One could even argue that it probably isn't the best choice for something like a battery powered scaled down PC (which is what MS does with SmartPhone and Pocket PC) but it seems to be flexible enough to do it.
So timegettime() is better than tickcount() for PPC and Win? Thanks.
Dave H · 09 Jul 2003, 12:59 UTC — GetTickCount() slow?
Dave H wrote:
I've noticed that my programs, typically clocking themselves off the GetTickCount() function run fine on every Pocket PC (2000 or 2002), and even the Pocket PC 2000 emulator, but on the Pocket PC 2002 emulator they run 2 or more times slower...

Is this because the emulator is running slowly or is it a bug/eccentricity in the GetTickCount() function which could happen on a real device (i.e. GetTickCount doesn't reliably measure milliseconds at all...)?


This thread seems to be talking about Windows XP. I'm not talking about Windows XP, I'm talking about Windows CE.

Does anyone know why GetTickCount would run slow on the Pocket PC 2002 emulator?
The emulator is WinXP. All it does is emulate the PocketPC APIs and whatnot in an x86 environment. Basically, it is just a scaled down version of windows running in itself. It doesn't actually emulate any processor and/or OS, just the APIs.
Sergey Chaban · 09 Jul 2003, 13:47 UTC
PocketPC2002 emulator is based on Connectix VirtualPC and it's a real hardware emulator, older PocketPC, PalmPC etc. emus are indeed just wrappers. They are even two different machine targets - x86 and x86em, you can't just exchange PE files between them.
So maybe GetTickCount slowness is due to h/w emulation?
It is? Do you have any links about that, it's the first I've ever heard of it.
Ah, I see. I don't ever really use the PPC 2002 emulator, just the PPC 2000 emulator. There is no real point in compiling a special build just for PPC 2002, unless you need special features. Sorry.
Sergey Chaban · 09 Jul 2003, 18:02 UTC
Start PPC2002 or WinCE.NET emulator, then go to Help/About. It says "Virtual x86 Hardware Reference Board, Provided by Connectix Corporation...".
There is even Board Support Package for this "hardware" in the PB (I'm not sure but I think this emu is what's included in the PB emulation edition, so you can download it and there are all the drivers for this virtual board).
Neat, thanks for that, I'm not a programmer but I've been taught that the emulator really isn't an emulator :P
sponge wrote:
Neat, thanks for that, I'm not a programmer but I've been taught that the emulator really isn't an emulator :P


It's not a true emulator in the sense that Pocket PC 2002 runs on ARM, and the emulator doesn't emulate an ARM processor (it would be too slow), but it is improving.

The Pocket PC 2000 emulator is more like a wrapper for Windows function calls, however the Pocket PC 2002 is now very close to being an emulator/virtual machine, for example if you really had a portable device which had a x86 processor in it, instead of an ARM processor, it would be a perfect emulator for that device.