Changeset 9791ab5 for benchmark/readyQ
- Timestamp:
- Jun 24, 2020, 4:57:42 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8b58bae
- Parents:
- 564148f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/yield.cfa
r564148f r9791ab5 105 105 106 106 Time start, end; 107 BenchCluster cl ;107 BenchCluster cl = { 0 }; 108 108 #if !defined(__CFA_NO_STATISTICS__) 109 109 print_stats_at_exit( cl.self ); … … 113 113 { 114 114 Yielder threads[nthreads]; 115 printf("Starting\n"); 116 115 117 bool is_tty = isatty(STDOUT_FILENO); 116 printf("Starting\n");117 118 start = getTime(); 118 119 run = true; … … 121 122 unpark( threads[i] __cfaabi_dbg_ctx2 ); 122 123 } 123 for() { 124 sleep(500`ms); 125 end = getTime(); 126 if( (end - start) >= duration`s ) { 127 break; 128 } 129 if(is_tty) { 130 printf("\r%.4lf", (double)(end - start)`s); 131 fflush(stdout); 132 } 133 } 124 wait(duration, start, end, is_tty); 134 125 135 126 run = false; 136 127 end = getTime(); 137 printf(" Done\n");128 printf("\nDone\n"); 138 129 } 139 130 }
Note: See TracChangeset
for help on using the changeset viewer.