RE: Filling in a struct timespec with the current date?
RE: Filling in a struct timespec with the current date?
- Subject: RE: Filling in a struct timespec with the current date?
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Tue, 28 Jul 2009 12:57:04 -0400
- Thread-topic: Filling in a struct timespec with the current date?
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 :
>
> > I'm trying to use struct timespec, and I want to initialize
> it to the
> > 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.
Yeah, that is what I'm doing now; I was hoping there was a cleaner way, something along the lines of:
ERROR_CODE initWithCurrentDate(&myTimeSpec);
If there isn't, then such is life; I'll continue using what gettimeofday().
Thanks,
Cem Karan
_______________________________________________
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