Changeset 8cb6fcd
- Timestamp:
- May 4, 2017, 5:07:58 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- e0b8ccd5
- Parents:
- 29137d3
- Location:
- src/benchmark
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/CorCtxSwitch.c
r29137d3 r8cb6fcd 3 3 #include <thread> 4 4 5 #include <unistd.h> // sysconf 6 #include <sys/times.h> // times 7 #include <time.h> 8 9 inline unsigned long long int Time() { 10 timespec ts; 11 clock_gettime( 12 #if defined( __linux__ ) 13 CLOCK_THREAD_CPUTIME_ID, 14 #elif defined( __freebsd__ ) 15 CLOCK_PROF, 16 #elif defined( __solaris__ ) 17 CLOCK_HIGHRES, 18 #else 19 #error uC++ : internal error, unsupported architecture 20 #endif 21 &ts ); 22 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 23 } // Time 5 #include "bench.h" 24 6 25 7 coroutine GreatSuspender {}; … … 42 24 } 43 25 44 #ifndef N45 #define N 10000000046 #endif47 48 26 int main() { 49 27 const unsigned int NoOfTimes = N; -
src/benchmark/Monitor.c
r29137d3 r8cb6fcd 3 3 #include <thread> 4 4 5 #include <unistd.h> // sysconf 6 #include <sys/times.h> // times 7 #include <time.h> 8 9 inline unsigned long long int Time() { 10 timespec ts; 11 clock_gettime( 12 #if defined( __linux__ ) 13 CLOCK_THREAD_CPUTIME_ID, 14 #elif defined( __freebsd__ ) 15 CLOCK_PROF, 16 #elif defined( __solaris__ ) 17 CLOCK_HIGHRES, 18 #else 19 #error uC++ : internal error, unsupported architecture 20 #endif 21 &ts ); 22 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 23 } // Time 24 25 #ifndef N 26 #define N 10000000 27 #endif 5 #include "bench.h" 28 6 29 7 monitor mon_t {}; -
src/benchmark/SchedInt.c
r29137d3 r8cb6fcd 3 3 #include <thread> 4 4 5 #include <unistd.h> // sysconf 6 #include <sys/times.h> // times 7 #include <time.h> 8 9 inline unsigned long long int Time() { 10 timespec ts; 11 clock_gettime( 12 #if defined( __linux__ ) 13 CLOCK_THREAD_CPUTIME_ID, 14 #elif defined( __freebsd__ ) 15 CLOCK_PROF, 16 #elif defined( __solaris__ ) 17 CLOCK_HIGHRES, 18 #else 19 #error uC++ : internal error, unsupported architecture 20 #endif 21 &ts ); 22 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 23 } // Time 24 25 #ifndef N 26 #define N 10000000 27 #endif 5 #include "bench.h" 28 6 29 7 condition condA; -
src/benchmark/ThrdCtxSwitch.c
r29137d3 r8cb6fcd 3 3 #include <thread> 4 4 5 #include <unistd.h> // sysconf 6 #include <sys/times.h> // times 7 #include <time.h> 8 9 inline unsigned long long int Time() { 10 timespec ts; 11 clock_gettime( 12 #if defined( __linux__ ) 13 CLOCK_THREAD_CPUTIME_ID, 14 #elif defined( __freebsd__ ) 15 CLOCK_PROF, 16 #elif defined( __solaris__ ) 17 CLOCK_HIGHRES, 18 #else 19 #error uC++ : internal error, unsupported architecture 20 #endif 21 &ts ); 22 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 23 } // Time 24 25 #ifndef N 26 #define N 100000000 27 #endif 5 #include "bench.h" 28 6 29 7 int main() { -
src/benchmark/bench.c
r29137d3 r8cb6fcd 4 4 #include <thread> 5 5 6 #include <unistd.h> // sysconf 7 #include <sys/times.h> // times 8 #include <time.h> 9 10 inline unsigned long long int Time() { 11 timespec ts; 12 clock_gettime( 13 #if defined( __linux__ ) 14 CLOCK_THREAD_CPUTIME_ID, 15 #elif defined( __freebsd__ ) 16 CLOCK_PROF, 17 #elif defined( __solaris__ ) 18 CLOCK_HIGHRES, 19 #else 20 #error uC++ : internal error, unsupported architecture 21 #endif 22 &ts ); 23 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 24 } // Time 6 #include "bench.h" 25 7 26 8 //======================================= -
src/benchmark/csv-data.c
r29137d3 r8cb6fcd 3 3 #include <thread> 4 4 5 extern "C" { 6 #include <unistd.h> // sysconf 7 #include <sys/times.h> // times 8 #include <time.h> 9 } 10 11 inline unsigned long long int Time() { 12 timespec ts; 13 clock_gettime( 14 #if defined( __linux__ ) 15 CLOCK_THREAD_CPUTIME_ID, 16 #elif defined( __freebsd__ ) 17 CLOCK_PROF, 18 #elif defined( __solaris__ ) 19 CLOCK_HIGHRES, 20 #else 21 #error uC++ : internal error, unsupported architecture 22 #endif 23 &ts ); 24 return 1000000000LL * ts.tv_sec + ts.tv_nsec; 25 } // Time 5 #include "bench.h" 26 6 27 7 coroutine GreatSuspender {};
Note: See TracChangeset
for help on using the changeset viewer.