• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hardware Clock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hardware Clock


  • Subject: Re: Hardware Clock
  • From: Ed Wynne <email@hidden>
  • Date: Sat, 8 Jul 2006 13:59:20 -0400


On Jul 8, 2006, at 7:00 AM, Gerriet M. Denkmann wrote:


On 08.07.2006, at 08:48, Ed Wynne wrote:


On Jul 8, 2006, at 1:38 AM, Gerriet M. Denkmann wrote:
The problem: whenever (B) is initialized from (A) a random value in the range -0.5 ... +0.5 seconds is added to the time.
To test: make the time (B) equal to the correct wall clock time. Sleep. Awake. Compare time to wall clock. See difference of -0.5 ... +0.5 seconds.

The hardware clock is probably only second accurate and its likely the OS only samples it once, instead of polling for the next second increment. This would save about .5s (on average) from the wakeup time.

Yes; further proof for this is the fact that the system time after awakening always starts with a full second (no fractional part).


But: if the OS can poll the hardware clock, why can't I?

You could, if you knew how... and were sufficiently motivated.

Apple does not provide an API or document how to do this. On OS X you'll need a kext to talk to the SMU for current machines, the PMU on slightly older machines, and god knows what on even older machines. It also used to be different for laptops vs desktops, I don't know if it still is. So how do you do it? Get the appropriate linux kernel source and go spelunking, they've figured most of it out.

-Ed

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Hardware Clock (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Hardware Clock (From: "Shawn Erickson" <email@hidden>)
 >Re: Hardware Clock (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Hardware Clock (From: Ed Wynne <email@hidden>)
 >Re: Hardware Clock (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: iPhoto integration?
  • Next by Date: setPatternPhase: woes
  • Previous by thread: Re: Hardware Clock
  • Next by thread: [ANN] UKFilePathView
  • Index(es):
    • Date
    • Thread