1
0
mirror of https://github.com/golang/go synced 2024-11-22 06:34:40 -07:00

Update documentation around time.Sleep to specify its precision, and suggest

a possible interface for more granular sleep times.

Fixes issue #260.

R=rsc, r
CC=golang-dev
https://golang.org/cl/181058
This commit is contained in:
Devon H. O'Dell 2009-12-25 08:24:00 +11:00 committed by Rob Pike
parent 77f6f16660
commit 1245e93b2c

View File

@ -9,6 +9,7 @@ import (
"syscall" "syscall"
) )
// Sleep pauses the current goroutine for ns nanoseconds. // Sleep pauses the current goroutine for at least ns nanoseconds. Higher resolution
// It returns os.EINTR if interrupted. // sleeping may be provided by syscall.Nanosleep on some operating systems.
// Sleep returns os.EINTR if interrupted.
func Sleep(ns int64) os.Error { return os.NewSyscallError("sleep", syscall.Sleep(ns)) } func Sleep(ns int64) os.Error { return os.NewSyscallError("sleep", syscall.Sleep(ns)) }