]> Cypherpunks repositories - gostls13.git/commitdiff
time: add more docs on Sleep
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 28 Aug 2013 18:16:55 +0000 (11:16 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 28 Aug 2013 18:16:55 +0000 (11:16 -0700)
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

index 591fa27b090a2ffd3b0b719123d51ca9efddcf3c..4f55bebe62a6de33e5223db17c7adbbf635cf4fc 100644 (file)
@@ -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 {