From 8159b6901f0f18f213897f27d5bd4806c3e18ee2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 28 Aug 2013 11:16:55 -0700 Subject: [PATCH] time: add more docs on Sleep Merge the comment from runtime/time.goc ("at least") and also note that negative is okay and won't crash. I see people going out of their way to avoid passing a negative value to Sleep. R=golang-dev, adg, r, alex.brainman CC=golang-dev https://golang.org/cl/13271045 --- src/pkg/time/sleep.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/time/sleep.go b/src/pkg/time/sleep.go index 591fa27b09..4f55bebe62 100644 --- a/src/pkg/time/sleep.go +++ b/src/pkg/time/sleep.go @@ -4,7 +4,8 @@ package time -// Sleep pauses the current goroutine for the duration d. +// Sleep pauses the current goroutine for at least the duration d. +// A negative or zero duration causes Sleep to return immediately. func Sleep(d Duration) func nano() int64 {