Replace gettimeofday() with clock_gettime().

Monotone-Parent: be2cafa0e0f3ad58e016221538576750f39f68af
Monotone-Revision: add793b70c148f2ac26fcbac6fee5b6af22bac1c