source:
benchmark/schedext/upp.cc@
9eb7f07c
| Last change on this file since 9eb7f07c was 26fd986, checked in by , 6 years ago | |
|---|---|
|
|
| File size: 486 bytes | |
| Rev | Line | |
|---|---|---|
| [9f0b975] | 1 | #include <cstdio> |
| 2 | ||
| 3 | #include "bench.h" | |
| 4 | ||
| 5 | _Monitor M { | |
| 6 | public: | |
| 7 | void __attribute__((noinline)) call() {} | |
| [26fd986] | 8 | void __attribute__((noinline)) wait() { |
| [2316525] | 9 | for ( size_t i = 0; i < times; i++ ) { |
| [b4107c8] | 10 | _Accept(call); |
| 11 | } | |
| [9f0b975] | 12 | } |
| [2316525] | 13 | } m; |
| [9f0b975] | 14 | |
| 15 | _Task T { | |
| 16 | void main() { | |
| [b4107c8] | 17 | BENCH( |
| [26fd986] | 18 | for ( size_t i = 0; i < times; i++ ) { |
| 19 | m.call(); | |
| 20 | }, | |
| [b4107c8] | 21 | result |
| 22 | ) | |
| 23 | printf( "%g\n", result ); | |
| [9f0b975] | 24 | } |
| 25 | }; | |
| 26 | ||
| [b4107c8] | 27 | int main( int argc, char * argv[] ) { |
| 28 | BENCH_START() | |
| [9f0b975] | 29 | T t; |
| [26fd986] | 30 | m.wait(); |
| [dc33b5b] | 31 | } |
| [b4107c8] | 32 | |
| 33 | // Local Variables: // | |
| 34 | // tab-width: 4 // | |
| 35 | // End: // |
Note:
See TracBrowser
for help on using the repository browser.