replaced rdtsc implementation with gettimeofday for better accuracy and ARM compatibility