source:
benchmark/ctxswitch/pthreads.c
@
0e34a14
Last change on this file since 0e34a14 was b4107c8, checked in by , 5 years ago | |
---|---|
|
|
File size: 244 bytes |
Rev | Line | |
---|---|---|
[d67cdb7] | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | |
[f1dd17a] | 3 | |
4 | #include <sched.h> | |
[d67cdb7] | 5 | |
6 | #include "bench.h" | |
7 | ||
[b4107c8] | 8 | int main( int argc, char * argv[] ) { |
9 | BENCH_START() | |
[b7170a64] | 10 | BENCH( |
[b4107c8] | 11 | for (size_t i = 0; i < times; i++) { |
[b7170a64] | 12 | sched_yield(); |
13 | }, | |
14 | result | |
15 | ) | |
[b4107c8] | 16 | printf( "%g\n", result ); |
[dc33b5b] | 17 | } |
Note: See TracBrowser
for help on using the repository browser.