Re: Get time & milliseconds.



I disagree that it's "not serious". It's a reasonable workaround for sceanrios where you don't have ms resolution available in the hardware. You can always add additional checks and adjust priorities to help get a more accurate value, but the reality is that the clock serving up the time on damned near every device that runs CE does not provide ms resolution, so you can't magically get milliseconds from them. If you truly need a 100% real and accurate millisecond resolution clock, then you should have put it on the board and customized the OAL to use it to begin with.

-Chris


"ag" <ag@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:61A8CEED-4A2C-4279-8833-7938D3889B6E@xxxxxxxxxxxxxxxx
Chris,

Ok, this code is fun, but not serious ! What if in your get method, the
seconds are updated just after you compute the ms ? DateTimeNow and
GetTickCount aren't sourced from the same clock, aren't sync'ed. Your method
could return 999ms at the start of a new second.

arnaud.

"Chris Tacke, MVP" wrote:

Something like this?

http://community.opennetcf.com/articles/cf/archive/2007/11/20/getting-a-millisecond-resolution-datetime-under-windows-ce.aspx

-Chris


"ag" <ag@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FA8A4ABE-84CC-4609-A745-C53533C46EEC@xxxxxxxxxxxxxxxx
> Hello,
>
> I would like to record the actual time when a specific interrupt > occurs.
> Using GetSystemTime limits resolution to seconds, and I need
> milliseconds...
> What is the best solution ?
>
> GetTickCount returns milliseconds from the start of the device. I could
> have
> a thread waiting each start of a new second and record the tickcount. > How
> can
> I generate an event triggered when system time updates its seconds ?
>
> thanks for any help !
> arnaud.
>


.



Relevant Pages

  • Re: VB6 code runs different speeds on different PCs
    ... As you've discovered, the minimum Sleep period can be different on different machines (5 milliseconds on my own WinXP system, but longer than that on others I think). ... You can get whatever "game rate" you want in a closed loop of course, by checking a high resolution timing source. ... If I were you I would use a proper Timer with a higher resolution that the standard VB Timer and run your entire game in the Timer event. ... Admittedly, updating their positions more than once every ten milliseconds does appear to give smoother animation (even though the video frame rate simply cannot draw a new frame at a rate greater than every 10 milliseconds,or so, depending on your display settings) because it tends iron out the differences more. ...
    (microsoft.public.vb.general.discussion)
  • Re: Time::HiRes usleep on windows strange behaviour...please please help!!
    ... Your timer resolution will be equal to the time duration between system ticks. ... your maximum resolution will be ten milliseconds. ... Rather pointless to pursue faster speeds for internet transaction ...
    (comp.lang.perl.misc)
  • Re: timing VBA execution
    ... Not sure 10 milliseconds is enough resolution, ... > OSAX is Open Scripting Architecture eXtension - also called a Scripting ... > Since the PowerPC has a microsecond timer available, ...
    (microsoft.public.mac.office.excel)
  • Re: alternative to gettickcount
    ... before proceeding with a timing test). ... a dozen milliseconds before calling timeGetTime?] ... resolution of timeGetTime does NOT default to one millisecond. ... It's an XP system at the moment, and the resolution appears to be the ...
    (microsoft.public.vb.general.discussion)
  • Re: How to use SystemTimeToFileTime api?
    ... The dwLowDateTime entry contains the time in 100 nanosecond units whereas the SystemTime has a best resolution of one millisecond. ... In fact if you run the loop that I have suggested and if you look closely at the output in the ListBox you will see that you can also partially ignore the fifth and sixth low order digits as well, because they represent milliseconds and tens of milliseconds and the SystemTime only changes every ten milliseconds in XP and Vista. ...
    (microsoft.public.vb.general.discussion)