Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- // Return time as a monotonically increasing long expressed as nanoseconds
- long get_time(){
- long time =0;
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- time += (ts.tv_sec*1000000000);
- time += ts.tv_nsec;
- return time;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement