Changeset 90152a4 for benchmark/bench.h


Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 moved

Legend:

Unmodified
Added
Removed
  • benchmark/bench.h

    rf9feab8 r90152a4  
    66        #include <stdlib.h>
    77        #include <unistd.h>                                     // sysconf
    8         #include <sys/times.h>                                  // times
     8#if ! defined(__cforall)
    99        #include <time.h>
    10 #if defined(__cforall)
     10        #include <sys/time.h>
     11#else
    1112}
     13#include <time.hfa>
    1214#endif
    1315
    14 static inline unsigned long long int Time() {
     16
     17static inline unsigned long long int bench_time() {
    1518    struct timespec ts;
    1619    clock_gettime(
     
    3942        }                                               \
    4043        long long int StartTime, EndTime;       \
    41         StartTime = Time();                     \
     44        StartTime = bench_time();               \
    4245        statement;                                      \
    43         EndTime = Time();                               \
     46        EndTime = bench_time();                 \
    4447        unsigned long long int output =         \
    4548        ( EndTime - StartTime ) / n;
    4649
    47 unsigned int default_preemption() {
     50#if defined(__cforall)
     51Duration default_preemption() {
    4852        return 0;
    4953}
     54#endif
Note: See TracChangeset for help on using the changeset viewer.