Here\'s a little test I\'ve written to verify that time does indeed only run forwards in Linux.
#include #include bool timeG
gettimeofday() is not guaranteed to be monotonic. Use clock_gettime(CLOCK_MONOTONIC) if you need that guarantee.
gettimeofday()
clock_gettime(CLOCK_MONOTONIC)