Measure request time using SAPI and gettimeofday