Ignore:
Timestamp:
Oct 26, 2017, 12:16:10 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6395817
Parents:
4149d9d
Message:

Updated the creation and ctxswitch benchmark to all be consistent and flexible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/bench.h

    r4149d9d rb7170a64  
    3333
    3434#define BENCH(statement, output)                \
    35         size_t n = BENCH_N;                                     \
    36         if( argc > 2 ) return 1;                        \
    37         if( argc == 2 ) {                                       \
    38                 n = atoi(argv[1]);                              \
    39         }                                                                       \
    40         const unsigned int NoOfTimes = n;       \
     35        size_t n = BENCH_N;                     \
     36        if( argc > 2 ) return 1;                \
     37        if( argc == 2 ) {                               \
     38                n = atoi(argv[1]);              \
     39        }                                               \
    4140        long long int StartTime, EndTime;       \
    42         StartTime = Time();                                     \
    43         statement;                                                      \
    44         EndTime = Time();                                       \
     41        StartTime = Time();                     \
     42        statement;                                      \
     43        EndTime = Time();                               \
    4544        unsigned long long int output =         \
    46         ( EndTime - StartTime ) / NoOfTimes;
     45        ( EndTime - StartTime ) / n;
    4746
    4847unsigned int default_preemption() {
Note: See TracChangeset for help on using the changeset viewer.