The time function in time.h gives milliseconds since the epoch.
You use gettimeofday(2) which is defined in POSIX.1 and BSD.
It returns seconds and microseconds as defined in struct timeval from sys/time.h.