| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Also this doesnt seem to work. This should show me the up time assuming the machine was started on 1970/1/1 00:00:00. It says it has been up for 10 hours when the uptime command says over 1 day. What exactly am i doing wrong? Code: AbsoluteTime keyTimeAbs = UpTime(); Nanoseconds keyTimeNano = AbsoluteToNanoseconds(keyTimeAbs); double seconds = ((double) UnsignedWideToUInt64( keyTimeNano )) * 1e-9; NSDate *keyTimeDate = [NSDate dateWithTimeIntervalSince1970:seconds]; NSLog(@"Key event date: %@",keyTimeDate); Output: 2008-03-25 05:23:47.625 timeTest[5051:10b] Key event date: 1970-01-01 10:17:25 -0600 Uptime: 5:24 up 1 day, 4:57, 3 users, load averages: 0.56 0.55 0.53 On Mar 25, 2008, at 4:49 AM, Brian Bergstrand wrote: AbsoluteTime is CPU specific. You have to use the mach clock_* functions to convert the interval to nano seconds. The epoch for the converted value will be the standard UNIX epoch (1970/1/1 00:00:00). |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden This email sent to email@hidden
| References: | |
| >AbsoluteTime & IOHIKeyboard's _keyboardEventAction (From: Matt Burnett <email@hidden>) | |
| >Re: AbsoluteTime & IOHIKeyboard's _keyboardEventAction (From: Brian Bergstrand <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.