runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

taia_now.c (289B)


      1 /* Public domain. */
      2 
      3 #include <sys/types.h>
      4 #include <time.h>
      5 #include <sys/time.h>
      6 #include "taia.h"
      7 
      8 void taia_now(struct taia *t)
      9 {
     10   struct timeval now;
     11   gettimeofday(&now,(struct timezone *) 0);
     12   tai_unix(&t->sec,now.tv_sec);
     13   t->nano = 1000 * now.tv_usec + 500;
     14   t->atto = 0;
     15 }