source: benchmark/ctxswitch/pthreads.c

Last change on this file was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 4 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
[d67cdb7]1#include <stdio.h>
2#include <stdlib.h>
4#include <sched.h>
6#include "bench.h"
[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 );
Note: See TracBrowser for help on using the repository browser.