Use time(3) instead of gettimeofday(2) for `now`

Of timeval value, only `tv_sec` member is being used. Since precision
is not needed, and since gettimeofday() function could be missing on
non-POSIX systems, it is better to use time() function instead.