summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/runtime/go-now.c
diff options
context:
space:
mode:
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/runtime/go-now.c')
-rw-r--r--llgo/third_party/gofrontend/libgo/runtime/go-now.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/llgo/third_party/gofrontend/libgo/runtime/go-now.c b/llgo/third_party/gofrontend/libgo/runtime/go-now.c
index ea8d070e9f3..d24e6ee76af 100644
--- a/llgo/third_party/gofrontend/libgo/runtime/go-now.c
+++ b/llgo/third_party/gofrontend/libgo/runtime/go-now.c
@@ -13,11 +13,11 @@
struct time_now_ret
now()
{
- struct timeval tv;
+ struct timespec ts;
struct time_now_ret ret;
- gettimeofday (&tv, NULL);
- ret.sec = tv.tv_sec;
- ret.nsec = tv.tv_usec * 1000;
+ clock_gettime (CLOCK_REALTIME, &ts);
+ ret.sec = ts.tv_sec;
+ ret.nsec = ts.tv_nsec;
return ret;
}
OpenPOWER on IntegriCloud