source: src/benchmark/bench.h @ 18ca28e

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 18ca28e was d67cdb7, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

merge

  • Property mode set to 100644
File size: 631 bytes
Line 
1#pragma once
2
3#ifdef __CFORALL__
4extern "C" {
5#endif
6        #include <unistd.h>                                     // sysconf
7        #include <sys/times.h>                                  // times
8        #include <time.h>
9#ifdef __CFORALL__
10}
11#endif
12
13static inline unsigned long long int Time() {
14    struct timespec ts;
15    clock_gettime(
16#if defined( __linux__ )
17         CLOCK_THREAD_CPUTIME_ID,
18#elif defined( __freebsd__ )
19         CLOCK_PROF,
20#elif defined( __solaris__ )
21         CLOCK_HIGHRES,
22#else
23    #error uC++ : internal error, unsupported architecture
24#endif
25         &ts );
26    return 1000000000LL * ts.tv_sec + ts.tv_nsec;
27} // Time
28
29#ifndef N
30#define N 10000000
31#endif
32
33unsigned int default_preemption() {
34        return 0;
35}
Note: See TracBrowser for help on using the repository browser.