Re: capturing and printing timestamps
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Daniel Dupas