This commit is contained in:
Mark McGranaghan 2012-09-23 04:17:40 -04:00
parent 5b7c5e7f3f
commit e9b82fac25
5 changed files with 13 additions and 10 deletions

View File

@ -11,3 +11,6 @@ func main() {
fmt.Println("====== Output")
fmt.Print(string(out))
}
// == todo
// full command lines with bash?

View File

@ -9,7 +9,7 @@ func main() {
fmt.Println("Tick at", t)
}
}()
time.Sleep(time.Millisecond * 3000)
time.Sleep(time.Millisecond * 1500)
ticker.Stop()
fmt.Println("Ticker stopped")
}

View File

@ -1,20 +1,20 @@
package main
import ("time"; "fmt")
import "time"
import "fmt"
func main() {
timer1 := time.NewTimer(time.Millisecond * 500)
timer1 := time.NewTimer(time.Second)
<- timer1.C
fmt.Println("Timer 1 expired")
stopped1 := timer1.Stop()
fmt.Println("Timer 2 stopped:", stopped1)
stop1 := timer1.Stop()
fmt.Println("Timer 2 stopped:", stop1)
timer2 := time.NewTimer(time.Second)
go func() {
<- timer2.C
fmt.Println("Timer 2 expired")
}()
time.Sleep(time.Millisecond * 500)
stopped2 := timer2.Stop()
fmt.Println("Timer 2 stopped:", stopped2)
stop2 := timer2.Stop()
fmt.Println("Timer 2 stopped:", stop2)
}

View File

@ -82,7 +82,7 @@ scatter-gather
sha1
signals
sort
sortby
sort-by-function
spawn
string-formatting
tcp-client
@ -92,4 +92,4 @@ time
timers
url
users
worker-pool
worker-pool