source:
benchmark/ctxswitch/kos_fibre2.cpp
@
df8ba61a
Last change on this file since df8ba61a was b4107c8, checked in by , 5 years ago | |
---|---|
|
|
File size: 445 bytes |
Line | |
---|---|
1 | #include <libfibre/fibre.h> |
2 | |
3 | #include "bench.h" |
4 | |
5 | volatile bool done = false; |
6 | |
7 | static void f1main() { |
8 | while(!done) { |
9 | Fibre::yield(); |
10 | } |
11 | } |
12 | |
13 | int 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.