site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jul 28, 2009, at 9:57 AM, Karan, Cem (Civ, ARL/CISD) wrote: Jean-Daniel Dupas wrote on Tuesday, July 28, 2009 12:52 PM Le 28 juil. 09 à 18:42, Karan, Cem (Civ, ARL/CISD) a écrit : current date (sec & nanosec). Is there a function call that I can call that will do so, or do I have to roll my own? Note that I'm looking for an API that will fill in a timespec that I pass in, not create a new one on the heap. You can wrap your own using gettimeofday() which does what you want but using a timeval instead of a timespec. ERROR_CODE initWithCurrentDate(&myTimeSpec); Kevin _______________________________________________ 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... I'm trying to use struct timespec, and I want to initialize it to the Yeah, that is what I'm doing now; I was hoping there was a cleaner way, something along the lines of: If there isn't, then such is life; I'll continue using what gettimeofday(). Wrapping gettimeofday(3) is the way to go. There is a POSIX REALTIME interface clock_gettime(3) that returns a struct timespec, but Mac OS X does not implement these optional interfaces. This email sent to site_archiver@lists.apple.com