<sys/time.h> is needed for gettimeofday.