/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <sys/time.h>
#include <stdio.h>

int main()
{
   struct timeval tv1,tv2;
   struct timezone tz1,tz2;
   gettimeofday(&tv1,&tz1);
   sleep(10);
   gettimeofday(&tv2,&tz2);
   printf("%ld\n",(tv2.tv_sec-tv1.tv_sec)*1000000+(tv2.tv_usec-tv1.tv_usec));
   return 0;
}
