Last change
on this file since 5a1ae14 was
2316525,
checked in by Peter A. Buhr <pabuhr@…>, 5 years ago
|
update benchmarks for concurrency paper
|
-
Property mode set to
100644
|
File size:
376 bytes
|
Line | |
---|
1 | #include <cstdio> |
---|
2 | |
---|
3 | #include "bench.h" |
---|
4 | |
---|
5 | _Coroutine C { |
---|
6 | void main() { |
---|
7 | while( true ) { |
---|
8 | suspend(); |
---|
9 | } |
---|
10 | } |
---|
11 | public: |
---|
12 | void do_resume() { |
---|
13 | resume(); |
---|
14 | } |
---|
15 | } c; |
---|
16 | int main( int argc, char * argv[] ) { |
---|
17 | BENCH_START() |
---|
18 | BENCH( |
---|
19 | for (size_t i = 0; i < times; i++) { |
---|
20 | c.do_resume(); |
---|
21 | }, |
---|
22 | result |
---|
23 | ) |
---|
24 | printf( "%g\n", result ); |
---|
25 | } |
---|
26 | |
---|
27 | // Local Variables: // |
---|
28 | // tab-width: 4 // |
---|
29 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.