Skip to content

Instantly share code, notes, and snippets.

@yifan-gu
Created March 28, 2016 20:55
Show Gist options
  • Save yifan-gu/82d23a208357c043f6cc to your computer and use it in GitHub Desktop.
Save yifan-gu/82d23a208357c043f6cc to your computer and use it in GitHub Desktop.
time test
package main
import "time"
import "runtime"
func main() {
for i := 0; i < 4; i++ {
go func() {
for {
runtime.Gosched()
}
}()
}
<-time.After(time.Second * 10)
}
@yifan-gu
Copy link
Author

time ./testtime

real 0m10.003s
user 0m31.932s
sys 0m6.612s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment