Re: Get system time in Milliseconds



The point we're all trying to make is that there is no simple way to do this
(if there was, the OEM would have filled in the seconds field in the
SystemTime for you).

The general premise for getting it working is at some point after startup
you need to watch the clock in a tight loop. When the second rolls over,
you need to use GetTickCount to find out your ms offset at the second
rollover. The last 3 digits are what's important.

From that point on, when you need the time with milliseconds it requires
that you get the system time and then call GetTickCount and use modulo
division that offset to find out how far (in milliseconds) you are from the
second rollover.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com


"birinder via PocketPCJunkies.com" <u37616@uwe> wrote in message
news:7b7a153cef793@xxxxxx
Dear all

Thanks for your response and support.

GetTickCount() return milliseconds since the PC restart. So still i am not
able to get the correct (almost) time of the clock with Millisecond
resolution. So can anyone suggest how to read the software realtime clock,
and how to sysnc this will hardware RTC periodically.

Thanks and best regards.
Birindder

--
Message posted via PocketPCJunkies.com
http://www.pocketpcjunkies.com/Uwe/Forums.aspx/wince-programming/200711/1



.



Relevant Pages

  • Re: simple time server
    ... But I would still need an SNTP server program unlike what's available ... that and it should keep your clock within a hundred milliseconds of the ... server unless you have a machine with a really bad local clock. ... For my computers on the Internet, I have been doing something like ...
    (comp.protocols.time.ntp)
  • Re: Post processing of NTP data...
    ... When queried as to the time using O/S services, these systems respond with the current value of the clock register. ... milliseconds and the typical error is 5 milliseconds. ... Some very new hardware designs allow ntpd to interpolate between "ticks" and yield a much more precise time, if and only if, you use NTP supplied functions to get the time. ...
    (comp.protocols.time.ntp)
  • Re: Accurate Timing in ruby
    ... I'm attempting to make an action-driven game with ruby ... I fear what you see is not Ruby's fault, but your hardware/OS clock. ... You don't round to milliseconds before you compute the fps, ... on the action-- is quite possible on today's hardware; ...
    (comp.lang.ruby)
  • Re: real time clock running at double speed
    ... Get your watch or a wall clock with a second hand. ... to pass the parameter "noapic" as a kernel boot parameter. ... So I got 5978 ticks in about 6000 ... milliseconds or one tick per millisecond. ...
    (comp.os.linux.setup)
  • Re: Total number of seconds since computer was started
    ... The GetTickCount function returns the number of milliseconds since ... Dim ComputerHours As Long ... Here's how I typically break down milliseconds into H:MM:SS... ... Dim Rtn As String ...
    (microsoft.public.word.vba.general)