In my project I'm using struct timespec as follows
struct timespec start, end;
clock_gettime(CLOCK_REALTIME,&start);
/* Do something */
clock_gettime(CLOCK_REALTIME,&end);
It returns a value as ((((unsigned64)start.tv_sec) * ((unsigned64)(1000000000L))) + ((unsigned64)(start.tv_nsec))))
Can anyone tell why we are using the unsigned64 format and also help me understand this structure in detail?? I'm using this code in my study about time calculation in nanoseconds precision for the code execution time taken