Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: capturing and printing timestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capturing and printing timestamps



Le 25 nov. 2010 à 13:08, Joel Reymont a écrit :

> I need to capture packets in a circular buffer and timestamp them.
>
> I also need to print my buffer when certain conditions are met, e.g. on error.
>
> What is the most convenient way to capture a timestamp for later printing as a hh:mm:ss:xxx?
>
> Can I convert mach_absolute_time() into a time format?
>
> 	Thanks, Joel


CFAbsoluteTimeGetCurrent() or if CoreFoundation is not available, gettimeofday().
You can then use a CFDateFormatterRef or strftime() to create your string.

 mach_absolute_time() represents an Up Time, not a wall time.

-- Jean-Daniel




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

This email sent to email@hidden

References: 
 >capturing and printing timestamps (From: Joel Reymont <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.