Time measurement with gettimeofday