struct timeval tv;
int sec = tv.tv_sec;
int usec = tv.tv_usec;
The system’s notion of the current Greenwich time and the current time zone is obtained with the gettimeofday() call, and set with the ettimeofday() call. The time is expressed in seconds and microseconds since midnight (0 hour), January 1, 1970. The resolution of the system clock is hardware dependent, and the time may be updated continuously or in “ticks.” If tp is NULL and tzp is non-NULL, gettimeofday() will opulate the timezone struct in tzp. If tp is non-NULL and tzp is NULL, then only the timeval struct in tp is populated. If both tp and tzp are NULL, nothing is returned.
Check out the man page for more info.