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 bfd4974 was d67cdb7, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago |
merge
|
-
Property mode
set to
100644
|
File size:
631 bytes
|
Line | |
---|
1 | #pragma once
|
---|
2 |
|
---|
3 | #ifdef __CFORALL__
|
---|
4 | extern "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 |
|
---|
13 | static 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 |
|
---|
33 | unsigned int default_preemption() {
|
---|
34 | return 0;
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.