Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualÁlvaro

Posted 02 January 2013 - 05:34 PM

Linux has clock_gettime()
 
Use it with CLOCK_MONOTONIC, and it should give you nanosecond resolution.

Hmmm... That's what I use, but with CLOCK_REALTIME. Do you know why one is preferable over the other?

EDIT: After a bit of searching, it seems CLOCK_MONOTONIC will behave better if the clock is adjusted (say, by ntpd).

#1Álvaro

Posted 02 January 2013 - 05:30 PM

Linux has clock_gettime()
 
Use it with CLOCK_MONOTONIC, and it should give you nanosecond resolution.

Hmmm... That's what I use, but with CLOCK_REALTIME. Do you know why one is preferable over the other?

PARTNERS