suitcase

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

taia_now.c (317B)


      1 #include <sys/types.h>
      2 #include <sys/time.h>
      3 #include <tai/taia.h>
      4 
      5 /* XXX: breaks tai encapsulation */
      6 
      7 void taia_now(struct taia *t)
      8 {
      9   struct timeval now;
     10   gettimeofday(&now,(struct timezone *) 0);
     11   t->sec.x = 4611686018427387914ULL + (uint64) now.tv_sec;
     12   t->nano = 1000 * now.tv_usec + 500;
     13   t->atto = 0;
     14 }