Changeset bdfc032 for benchmark/ctxswitch/goroutine.go
- Timestamp:
- Feb 4, 2020, 11:35:26 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- eef8dfb
- Parents:
- aefb247 (diff), 4f7b418 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/ctxswitch/goroutine.go
raefb247 rbdfc032 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.