gettimeofday

Calculates the time and timezone.

int gettimeofday (struct timeval * timev, struct timevzone * timez);

Required Header
<time.h>

Return Value

This function returns zero if successful. -1 indicates an error.

Parameters

timev

  A pointer to the time value result

timez

  A pointer to the time zone result

Remarks

The gettimeofday function stores the current time in timev and timez as follows:

struct timeval {
    long tv_sec;
    long tv_usec;
};

struct timezone {
    long tz_minuteswest;
    long tz_dsttime;
};

Time

See Also    time