source: src/benchmark/bench.h@ ab4bff5

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since ab4bff5 was d67cdb7, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago

merge

  • Property mode set to 100644
File size: 631 bytes
RevLine 
[8cb6fcd]1#pragma once
2
[d67cdb7]3#ifdef __CFORALL__
[8cb6fcd]4extern "C" {
[d67cdb7]5#endif
[8cb6fcd]6 #include <unistd.h> // sysconf
7 #include <sys/times.h> // times
8 #include <time.h>
[d67cdb7]9#ifdef __CFORALL__
[8cb6fcd]10}
[d67cdb7]11#endif
[8cb6fcd]12
[d67cdb7]13static inline unsigned long long int Time() {
14 struct timespec ts;
[8cb6fcd]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
[7286a40]31#endif
32
33unsigned int default_preemption() {
34 return 0;
35}
Note: See TracBrowser for help on using the repository browser.