Ignore:
Timestamp:
Oct 26, 2017, 12:16:10 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, 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/ctxswitch/cfa_thrd.c

    r4149d9d rb7170a64  
    1 #include <fstream>
    2 #include <stdlib>
     1#include <stdio.h>
    32#include <thread>
    43
    54#include "bench.h"
    65
    7 int main() {
    8         const unsigned int NoOfTimes = N;
    9         long long int StartTime, EndTime;
     6int main(int argc, char* argv[]) {
     7        BENCH(
     8                for (size_t i = 0; i < n; i++) {
     9                        yield();
     10                },
     11                result
     12        )
    1013
    11         StartTime = Time();
    12         for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) {
    13                 yield();
    14         }
    15         EndTime = Time();
    16 
    17         sout | ( EndTime - StartTime ) / NoOfTimes | endl;
     14        printf("%llu\n", result);
    1815}
Note: See TracChangeset for help on using the changeset viewer.