source: benchmark/ctxswitch/kos_fibre2.cpp @ 41870a5

ADTast-experimentalenumpthread-emulationqualifiedEnum
Last change on this file since 41870a5 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: 445 bytes
Line 
1#include <libfibre/fibre.h>
2
3#include "bench.h"
4
5volatile bool done = false;
6
7static void f1main() {
8        while(!done) {
9                Fibre::yield();
10        }
11}
12
13int main( int argc, char * argv[] ) {
14        BENCH_START()
15        Fibre* f1 = (new Fibre)->run(f1main);
16        BENCH(
17                for (size_t i = 0; i < times; i++) {
18                        Fibre::yield();
19                },
20                result
21        )
22        printf( "%g\n", result );
23        done = true;
24        Fibre::yield();
25        f1->join();
26}
27
28// Local Variables: //
29// tab-width: 4 //
30// End: //
Note: See TracBrowser for help on using the repository browser.