I once did this by calculating the true time every time the application started
or woke up using something like this:
UInt32 gTicks = 0;
void CalcStartingTick()
{
gTicks = TimGetTicks();
UInt32 seconds = TimGetSeconds();
UInt32 secondsTwo = 0;
do{
gTicks = TimGetTicks();
secondsTwo=TimGetSeconds();
}while (secondsTwo !=seconds);
}
// now everytime you need the time call
UInt32 seconds = TimGetSeconds();
UInt32 hunderedthOfSecond = ((TimGetTicks() - gTicks) % SysTicksPerSecond()) *
100 / SysTicksPerSecond();
But remember: call CalcStartingTick everytime the device might have slept!
CalcStartingTick takes about a second to run. And as you can understand, this
will not be perfectly accurate, and can be off by a couple of ticks.
Good Luck,
LionScribe
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/