#include <sys/time.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
struct timeval tv;
struct timezone tz;
if(0 == gettimeofday(&tv, &tz))
{
printf("Time since the Unix epoch: %lu.%lu\n",
(unsigned long)tv.tv_sec,
(unsigned long)tv.tv_usec);
}
else
printf("ERROR: Call to gettimeofday() failed.\n");
return(0);
}