I think this is really an API compatibility issue. POSIX-y calls pselect() and clock_gettime() use struct timespec . Various file system calls, such as utimes() , and some various Linux calls, such as gettimeofday() and select() , use struct timeval . In general, from several man pages I suspect that struct timeval has a BSD legacy, whereas struct timespec is POSIX.
If you take interval measurements, there is no reason not to use the extra accuracy from clock_gettime() - although be careful that this is usually hardware and not a header file that limits your measurement accuracy. Dividing by a million for display purposes is hardly better or worse than dividing by a thousand. In addition, Mac OS X does not support clock_gettime() .
But if you do a lot of file manipulation, it may make sense to use the struct timeval used in the API, for example utimes() . struct timeval also has some comparison functions on Linux, BSD, and Mac OS X, for example. timercmp() , timersub() (see the manual pages again).
I would make a decision based on the APIs that you intend to use, and not on the structures themselves. (Or, if necessary, write a wrapper class with conversion methods.)
lyngvi
source share