Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <time.h>
  2.  
  3. // Return time as a monotonically increasing long expressed as nanoseconds
  4. long get_time(){
  5.  
  6. long time =0;
  7. struct timespec ts;
  8.  
  9. clock_gettime(CLOCK_MONOTONIC, &ts);
  10. time += (ts.tv_sec*1000000000);
  11. time += ts.tv_nsec;
  12.  
  13. return time;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement