Hi,

Thanks for your help. I now use UpTime() because I dont't have to do anything in a Cocoa app to get this running. I use the following code to get the timestamp:

double timestamp = (double)(AbsoluteToDuration(UpTime())) / 1000.0;

Then I use this timestamp to create NSEvents.

With best wishes, Stefan


Am 24.06.2008 um 15:11 schrieb Jean-Daniel Dupas:

Sorry, it look easy with sysctl too.
That just that I had some bad experiences with sysctl to retreive some poorely documented values and structs.


Le 24 juin 08 à 15:07, Jean-Daniel Dupas a écrit :

Wow, that one of the more complexe way i see to retreive it.

The former equivalent of GetCurrentEventTime() is -[NSEvent timestamp].

But if you need the uptime without using an event, you can use mach_absolute_time() or UpTime() (from the CoreServices framework).


Le 24 juin 08 à 15:00, Chris a écrit :



Do a

man 3 sysctl

in the terminal and look for KERN_BOOTTIME






On 24/06/2008, at 10:51 PM, Stefan Hafeneger wrote:

Hi,

I'm looking for a Cocoa function like GetCurrentEventTime() for Carbon to get the interval since system startup. Any ideas?

With best wishes, Stefan_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/ idou747%40gmail.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/stefan.hafeneger%40mac.com

This email sent to [EMAIL PROTECTED]

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to