- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/ctxswitch/goroutine.go
r50cfa99 rbf71cfd 2 2 3 3 import ( 4 "fmt" 5 "time" 6 "os" 7 "strconv" 8 "runtime" 4 "fmt" 5 "runtime" 6 "time" 9 7 ) 10 8 … … 30 28 31 29 func main() { 32 var times int = 10000000 33 if len( os.Args ) > 2 { os.Exit( 1 ) } 34 if len( os.Args ) == 2 { times, _ = strconv.Atoi(os.Args[1]) } 35 go ContextSwitch( times ) // context switch 30 const NoOfTimes = 10000000 31 go ContextSwitch( NoOfTimes ) // context switch 36 32 <- shake 37 33 } 38 39 // Local Variables: //40 // tab-width: 4 //41 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.