Fix gethrvtime and reorganize to decrease the average number of tests