Quote:
Originally Posted by jf.argentino
That's not so difficult! Or am I missing something?
|
No you're right, it's not very difficult. It was more a question I was raising since I hadn't worked with timespecs at all before so I wanted to ensure the approach I was taking is correct. Currently I have it implemented as such:
Code:
struct timeval tv
struct timespec ts;
s64 nsec;
do_gettimeofday(&tv);
nsec = timeval_to_ns(&tv);
ts = ns_to_timespec(nsec);
Seems simple enough but there's certain things I want to make sure I have covered. For instance, does this handle the assignment of the tv_sec member variables or is it concerned with only the usec to nsec? ns_to_timespec returns a timespec struct, not just a long value that would be consistent with operating solely on the nsec memeber. Hopefully if the design of the function is consistent then it handles both.
I've yet to look past the header file into the source C file. I'll do that when I get the chance, hopefully in about 30 mins or so.