diff --git a/examples/timers/timers.go b/examples/timers/timers.go index d0256e6..d63c48f 100644 --- a/examples/timers/timers.go +++ b/examples/timers/timers.go @@ -38,4 +38,7 @@ func main() { if stop2 { fmt.Println("Timer 2 stopped") } + + // Give timer2 enough time if it has to expire. + time.Sleep(2) } diff --git a/examples/timers/timers.hash b/examples/timers/timers.hash index 8c0f2c4..498375e 100644 --- a/examples/timers/timers.hash +++ b/examples/timers/timers.hash @@ -1,2 +1,2 @@ -e8e501d6083bea786629ca5e485e8b18caab4815 -pLnKEIesooU +c7157df6604e894d7660af0a28442652e7bc2cd6 +969wzKNNiWA diff --git a/public/timers b/public/timers index 977afef..eec9efb 100644 --- a/public/timers +++ b/public/timers @@ -45,7 +45,7 @@ at tickers.

- +
package main
 
@@ -119,7 +119,7 @@ that you can cancel the timer before it expires. Here’s an example of that.

- +
    timer2 := time.NewTimer(time.Second)
     go func() {
@@ -130,6 +130,19 @@ Here’s an example of that.

if stop2 { fmt.Println("Timer 2 stopped") } +
+ + + + + + +

Give timer2 enough time if it has to expire

+ + + + +
    time.Sleep(2)
 }
 
@@ -170,7 +183,7 @@ a chance to expire.