Ignore:
Timestamp:
Jun 24, 2020, 4:57:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Harmonized readv and yield benchmark

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/yield.cfa

    r564148f r9791ab5  
    105105
    106106                Time start, end;
    107                 BenchCluster cl;
     107                BenchCluster cl = { 0 };
    108108                #if !defined(__CFA_NO_STATISTICS__)
    109109                        print_stats_at_exit( cl.self );
     
    113113                        {
    114114                                Yielder threads[nthreads];
     115                                printf("Starting\n");
     116
    115117                                bool is_tty = isatty(STDOUT_FILENO);
    116                                 printf("Starting\n");
    117118                                start = getTime();
    118119                                run = true;
     
    121122                                        unpark( threads[i] __cfaabi_dbg_ctx2 );
    122123                                }
    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);
    134125
    135126                                run = false;
    136127                                end = getTime();
    137                                 printf("Done\n");
     128                                printf("\nDone\n");
    138129                        }
    139130                }
Note: See TracChangeset for help on using the changeset viewer.