Changeset 136ccd7 for src/benchmark/bench.h
- Timestamp:
- Nov 3, 2017, 3:01:31 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4ee36bf0
- Parents:
- 4ee1efb (diff), 760ba67 (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
-
src/benchmark/bench.h
r4ee1efb r136ccd7 1 1 #pragma once 2 2 3 #if def __CFORALL__3 #if defined(__CFORALL__) 4 4 extern "C" { 5 5 #endif 6 #include <stdlib.h> 6 7 #include <unistd.h> // sysconf 7 8 #include <sys/times.h> // times 8 9 #include <time.h> 9 #if def __CFORALL__10 #if defined(__CFORALL__) 10 11 } 11 12 #endif … … 27 28 } // Time 28 29 29 #ifndef N30 #define N1000000030 #ifndef BENCH_N 31 #define BENCH_N 500 //10000000 31 32 #endif 33 34 #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 long long int StartTime, EndTime; \ 41 StartTime = Time(); \ 42 statement; \ 43 EndTime = Time(); \ 44 unsigned long long int output = \ 45 ( EndTime - StartTime ) / n; 32 46 33 47 unsigned int default_preemption() {
Note: See TracChangeset
for help on using the changeset viewer.