Changes in src/benchmark/bench.h [b7170a64:d67cdb7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/bench.h
rb7170a64 rd67cdb7 1 1 #pragma once 2 2 3 #if defined(__CFORALL__)3 #ifdef __CFORALL__ 4 4 extern "C" { 5 5 #endif 6 #include <stdlib.h>7 6 #include <unistd.h> // sysconf 8 7 #include <sys/times.h> // times 9 8 #include <time.h> 10 #if defined(__CFORALL__)9 #ifdef __CFORALL__ 11 10 } 12 11 #endif … … 28 27 } // Time 29 28 30 #ifndef BENCH_N31 #define BENCH_N 500 //1000000029 #ifndef N 30 #define N 10000000 32 31 #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;46 32 47 33 unsigned int default_preemption() {
Note: See TracChangeset
for help on using the changeset viewer.