Current Time in milliseconds

  • Thread starter Thread starter Oz
  • Start date Start date
O

Oz

Hi all,

I'm using an HP iPAQ 5500 and I need to get the current time down to the
millisecond. Date.Now returns time down to the second, but that is not
accurate enough for my needs.

I can't use a timer since I need to keep track of time through
application/windows restarts.

Any ideas?

TIA.
Oz
 
I've yet to see a CE device that support the SystemTime down to the
millisecond. In fact the desktop is only down to about 80ms. If you need a
ms timer, use the system tick, or a performance counter for even finer
resolution.


-Chris
 
The issue is not with the timers at all. I need to be able to re-sync
with the system clock after a soft/hard reset so I need to get better
than 1 second resolution of the current time. 100 (maybe even 200) ms
resolution would be adaquate.

System.Environment.Ticks is of no value since it resets every time you
reboot and the app has to work between soft resets.

I've thought about starting a number of timers ( maybe 1 timer every
50-100 ms ) and checking which is the first to tick over to the next
second and using that one as a re-sync though this sounds a bit nasty.

Or starting a performance counter that polled the time every 10 ms until
the second ticked over and then kicked off a timer.

Is this just an OEM (HP iPAQ 5500) limitation that has no real solution?

Thanks again.
Oz
 
Yes, it's an OEM limitation (and common among all CE OEMs that I've used).
While the SYSTEMTIME structure itself has a milliseconds field, I've never
seen a kernel implementation that actually used it. Not saying that it
can't be done, just that I've never seen it.
 
Back
Top