dendrite/vendor/src/github.com/tj/go-debug/example/multiple.go
Robert Swain 091bd770ed vendor: Add bimg image processing library
bimg is MIT licensed. It depends on the C library libvips which is LGPL
v2.1+ licensed. libvips must be installed separately.
2017-06-03 10:33:05 +02:00

26 lines
415 B
Go

package main
import . "github.com/visionmedia/go-debug"
import "time"
var a = Debug("multiple:a")
var b = Debug("multiple:b")
var c = Debug("multiple:c")
func work(debug DebugFunction, delay time.Duration) {
for {
debug("doing stuff")
time.Sleep(delay)
}
}
func main() {
q := make(chan bool)
go work(a, 1000*time.Millisecond)
go work(b, 250*time.Millisecond)
go work(c, 100*time.Millisecond)
<-q
}