From 8cc764eca92c6882c0d19cf3282d94ee67e3ceea Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 3 Dec 2008 16:40:00 -0800 Subject: add time.Tick() R=r DELTA=130 (115 added, 1 deleted, 14 changed) OCL=20376 CL=20385 --- src/lib/syscall/time_amd64_darwin.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/syscall/time_amd64_darwin.go') diff --git a/src/lib/syscall/time_amd64_darwin.go b/src/lib/syscall/time_amd64_darwin.go index 011933b4f..7be6d6607 100644 --- a/src/lib/syscall/time_amd64_darwin.go +++ b/src/lib/syscall/time_amd64_darwin.go @@ -16,3 +16,9 @@ export func gettimeofday() (sec, nsec, errno int64) { } return r1, r2*1000, 0 } + +export func nstotimeval(ns int64, tv *Timeval) { + ns += 999; // round up + tv.sec = int64(ns/1000000000); + tv.usec = uint32(ns%1000000000 / 1000); +} -- cgit v1.2.3