Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JNI and NSSelector



"Nathan V. Roberts" <email@hidden> wrote:

>Chris's post indicated that the kernel clock
>might not jump. Correct me if I'm wrong on this, but wouldn't the
>kernel clock get reset on restart? I definitely want to be able to
>continue timing across boots.

To continue timing across restarts, you'll need a persistent timestamp
somewhere, such as a file in the file-system (or NVRAM). All you need is a
correlation between the current GMT time and current kernel time (microsecs
since boot). In other words, GMT time of X can always be correlated to
microseconds-since-boot of Y. The persistent timestamp need only store the
GMT time. Then at any future point you correlate the current
microseconds-since-boot to a corresponding current GMT time and perform
some simple arithmetic.

If the kernel clock does jump, then it's moot.

As long as you're worrying about time across restarts, remember to consider
what happens if the user sets the system time, either manually or via a
network time server. You'll get time-jumps then, too, possibly even a
backwards jump.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.