Changes in src/benchmark/CorCtxSwitch.c [b510ac2:8cb6fcd]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/CorCtxSwitch.c
rb510ac2 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;
Note: See TracChangeset
for help on using the changeset viewer.