diff options
author | Russ Cox <rsc@golang.org> | 2008-12-03 16:40:00 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2008-12-03 16:40:00 -0800 |
commit | 8cc764eca92c6882c0d19cf3282d94ee67e3ceea (patch) | |
tree | 06819a9b75d76f35e8ded91afa1296b96052d9fe /src/lib/syscall/time_amd64_linux.go | |
parent | c26d211eb3a0fac0b8427b41e3e1d4c30170c184 (diff) | |
download | golang-8cc764eca92c6882c0d19cf3282d94ee67e3ceea.tar.gz |
add time.Tick()
R=r
DELTA=130 (115 added, 1 deleted, 14 changed)
OCL=20376
CL=20385
Diffstat (limited to 'src/lib/syscall/time_amd64_linux.go')
-rw-r--r-- | src/lib/syscall/time_amd64_linux.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/syscall/time_amd64_linux.go b/src/lib/syscall/time_amd64_linux.go index 43b050119..f9b5f014d 100644 --- a/src/lib/syscall/time_amd64_linux.go +++ b/src/lib/syscall/time_amd64_linux.go @@ -14,3 +14,9 @@ export func gettimeofday() (sec, nsec, errno int64) { } return int64(tv.sec), int64(tv.usec*1000), 0 } + +export func nstotimeval(ns int64, tv *Timeval) { + ns += 999; // round up + tv.sec = int64(ns/1000000000); + tv.usec = uint64(ns%1000000000 / 1000); +} |