Re: Questions about mach_absolute_time
Re: Questions about mach_absolute_time
- Subject: Re: Questions about mach_absolute_time
- From: Jean-Francois Roy <email@hidden>
- Date: Tue, 6 May 2008 09:41:16 -0400
On May 5, 2008, at 17:38, Jens Alfke wrote:
(1) I believe mach_absolute_time counts the time since system boot.
Does that include time spent in sleep/hibernation, or does it stop
counting then?
Read http://lists.apple.com/archives/PerfOptimization-dev/2006/Jul/msg00024.html
concerning that question for a full discussion and investigation on
it. The conclusion was that mach_absolute_time increases monotonically
and accounts for sleep time on both PowerPC and Intel. See http://lists.apple.com/archives/PerfOptimization-dev/2006/Jul/msg00041.html
.
In addition, there seemed to be concern on dual-CPU PowerPC machines
whereby mach_absolute_time could return different values, and even go
backward in time, depending on which CPU it runs on (on PowerPC,
according to the thread, each CPU has its own time counter). You may
want to take additional steps concerning that, if PowerPC is on your
roadmap.
If you really need a bullet-proof answer, I'd go dig in the kernel to
see how mach_absolute_time is implemented (performance or clock
register, some other way), and determine its behavior based on how it
is implemented.
(2) Is there some kind of notification I can get when there's a
discontinuity in the system date, like after an ntpd correction? I
remember seeing something like this while skimming the i***** SDK,
but haven't seen the equivalent in Mac OS X.
Not that I'm aware of.
--
Disclaimer: the content of this email represents my personal opinions
and not those of my employer.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden