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