The following program demonstrates the gettimeofday system call, which returns the number of seconds since the UNIX Epoch (January 1, 1970) to microsecond accuracy. The program simply loops five times: each loop prints the current time and then sleeps for a second.