Changeset b7170a64 for src/benchmark/ctxswitch/cfa_thrd.c
- Timestamp:
- Oct 26, 2017, 12:16:10 PM (7 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:
- 6395817
- Parents:
- 4149d9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/ctxswitch/cfa_thrd.c
r4149d9d rb7170a64 1 #include <fstream> 2 #include <stdlib> 1 #include <stdio.h> 3 2 #include <thread> 4 3 5 4 #include "bench.h" 6 5 7 int main() { 8 const unsigned int NoOfTimes = N; 9 long long int StartTime, EndTime; 6 int main(int argc, char* argv[]) { 7 BENCH( 8 for (size_t i = 0; i < n; i++) { 9 yield(); 10 }, 11 result 12 ) 10 13 11 StartTime = Time(); 12 for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) { 13 yield(); 14 } 15 EndTime = Time(); 16 17 sout | ( EndTime - StartTime ) / NoOfTimes | endl; 14 printf("%llu\n", result); 18 15 }
Note: See TracChangeset
for help on using the changeset viewer.