Use gettimeofday() instead of obsolete ftime().
(Patch by Daniel Dickman.)