bugfix, using gettimeofday instead of clock_gettime