OSDN Git Service

libgo: Update to weekly.2011-12-14.
[pf3gnuchains/gcc-fork.git] / libgo / go / time / sleep.go
index 1e23118..b4680db 100644 (file)
@@ -4,6 +4,9 @@
 
 package time
 
+// Sleep pauses the current goroutine for the duration d.
+func Sleep(d Duration)
+
 func nano() int64 {
        sec, nsec := now()
        return sec*1e9 + int64(nsec)
@@ -72,13 +75,13 @@ func After(d Duration) <-chan Time {
        return NewTimer(d).C
 }
 
-// AfterFunc waits at least ns nanoseconds before calling f
+// AfterFunc waits for the duration to elapse and then calls f
 // in its own goroutine. It returns a Timer that can
 // be used to cancel the call using its Stop method.
-func AfterFunc(ns int64, f func()) *Timer {
+func AfterFunc(d Duration, f func()) *Timer {
        t := &Timer{
                r: runtimeTimer{
-                       when: nano() + ns,
+                       when: nano() + int64(d),
                        f:    goFunc,
                        arg:  f,
                },