Changeset b4107c8 for benchmark/mutex/pthreads.c
- Timestamp:
- Jan 7, 2020, 3:50:56 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 580c11b
- Parents:
- 846c026
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/mutex/pthreads.c
r846c026 rb4107c8 7 7 8 8 void __attribute__((noinline)) call() { 9 pthread_mutex_lock (&mutex);10 pthread_mutex_unlock( &mutex);9 pthread_mutex_lock( &mutex ); 10 pthread_mutex_unlock( &mutex ); 11 11 } 12 13 int main(int argc, char* argv[]) { 12 int main( int argc, char * argv[] ) { 13 BENCH_START() 14 14 BENCH( 15 for ( size_t i = 0; i < n; i++) {15 for ( size_t i = 0; i < times; i++ ) { 16 16 call(); 17 17 }, 18 18 result 19 19 ) 20 printf( "%g\n", result ); 21 } 20 22 21 printf("%g\n", result); 22 } 23 // Local Variables: // 24 // tab-width: 4 // 25 // End: //
Note: See TracChangeset
for help on using the changeset viewer.