Changeset 90152a4 for benchmark/bench.h
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (8 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, stuck-waitfor-destruct
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (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 moved
-
benchmark/bench.h (moved) (moved from src/benchmark/bench.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/bench.h
rf9feab8 r90152a4 6 6 #include <stdlib.h> 7 7 #include <unistd.h> // sysconf 8 #include <sys/times.h> // times 8 #if ! defined(__cforall) 9 9 #include <time.h> 10 #if defined(__cforall) 10 #include <sys/time.h> 11 #else 11 12 } 13 #include <time.hfa> 12 14 #endif 13 15 14 static inline unsigned long long int Time() { 16 17 static inline unsigned long long int bench_time() { 15 18 struct timespec ts; 16 19 clock_gettime( … … 39 42 } \ 40 43 long long int StartTime, EndTime; \ 41 StartTime = Time();\44 StartTime = bench_time(); \ 42 45 statement; \ 43 EndTime = Time();\46 EndTime = bench_time(); \ 44 47 unsigned long long int output = \ 45 48 ( EndTime - StartTime ) / n; 46 49 47 unsigned int default_preemption() { 50 #if defined(__cforall) 51 Duration default_preemption() { 48 52 return 0; 49 53 } 54 #endif
Note:
See TracChangeset
for help on using the changeset viewer.