Created
March 28, 2016 20:55
-
-
Save yifan-gu/82d23a208357c043f6cc to your computer and use it in GitHub Desktop.
time test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "time" | |
import "runtime" | |
func main() { | |
for i := 0; i < 4; i++ { | |
go func() { | |
for { | |
runtime.Gosched() | |
} | |
}() | |
} | |
<-time.After(time.Second * 10) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
time ./testtime
real 0m10.003s
user 0m31.932s
sys 0m6.612s