Changeset 6250a312 for src/benchmark/CorCtxSwitch.c
- Timestamp:
- May 10, 2017, 5:00:47 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:
- 8514fe19, dbfb35d
- Parents:
- 0f9bef3 (diff), 29cf9c8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/CorCtxSwitch.c
r0f9bef3 r6250a312 3 3 #include <thread> 4 4 5 #include <unistd.h> // sysconf 6 #include <sys/times.h> // times 7 #include <time.h> 5 #include "bench.h" 8 6 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 struct GreatSuspender { 26 coroutine_desc __cor; 27 }; 28 29 DECL_COROUTINE(GreatSuspender); 7 coroutine GreatSuspender {}; 30 8 31 9 void ?{}( GreatSuspender * this ) { … … 46 24 } 47 25 48 #ifndef N49 #define N 10000000050 #endif51 52 26 int main() { 53 27 const unsigned int NoOfTimes = N;
Note: See TracChangeset
for help on using the changeset viewer.