Is there any way to measure elapsed time in linux/unix without using system clock?
The problem is that system clock changes in some situations and elapsed time measured by time
or gettimeofday
or anything else like that gives incorrect result.
I'm thinking of creating separate thread which performs loop with sleep(100)
inside and counts number of repetitions.
Any better solutions?
Use monotonic time, which represents time since some point: http://linux.die.net/man/3/clock_gettime