source: benchmark/ctxswitch/pthreads.c @ 38f6e66

Last change on this file since 38f6e66 was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

  • Property mode set to 100644
File size: 244 bytes
RevLine 
[d67cdb7]1#include <stdio.h>
2#include <stdlib.h>
[f1dd17a]3
4#include <sched.h>
[d67cdb7]5
6#include "bench.h"
7
[b4107c8]8int 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.