aboutsummaryrefslogtreecommitdiff
path: root/taia_now.c
diff options
context:
space:
mode:
Diffstat (limited to 'taia_now.c')
-rw-r--r--taia_now.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/taia_now.c b/taia_now.c
new file mode 100644
index 0000000..ccc260d
--- /dev/null
+++ b/taia_now.c
@@ -0,0 +1,12 @@
+#include <sys/types.h>
+#include <sys/time.h>
+#include "taia.h"
+
+void taia_now(struct taia *t)
+{
+ struct timeval now;
+ gettimeofday(&now,(struct timezone *) 0);
+ tai_unix(&t->sec,now.tv_sec);
+ t->nano = 1000 * now.tv_usec + 500;
+ t->atto = 0;
+}