Equivalent to GetTickCount() on Linux

You can use CLOCK_MONOTONIC e.g. in C:

struct timespec ts;
if(clock_gettime(CLOCK_MONOTONIC,&ts) != 0) {
 //error
}

See this question for a Python way – How do I get monotonic time durations in python?

Leave a Comment