ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
deferred_resn
demangler
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
with_gc
|
Last change
on this file since 637dd9c was 399a908, checked in by Thierry Delisle <tdelisle@…>, 7 years ago |
|
Fixed benchmarks
|
-
Property mode
set to
100644
|
|
File size:
392 bytes
|
| Line | |
|---|
| 1 | #include <stdio.h>
|
|---|
| 2 | #include <kernel>
|
|---|
| 3 | #include <thread>
|
|---|
| 4 |
|
|---|
| 5 | #include "bench.h"
|
|---|
| 6 |
|
|---|
| 7 | coroutine GreatSuspender {};
|
|---|
| 8 |
|
|---|
| 9 | void ?{}( GreatSuspender & this ) {
|
|---|
| 10 | prime(this);
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | void main( GreatSuspender & this ) {
|
|---|
| 14 | while( true ) {
|
|---|
| 15 | suspend();
|
|---|
| 16 | }
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | int main(int argc, char* argv[]) {
|
|---|
| 20 | GreatSuspender s;
|
|---|
| 21 |
|
|---|
| 22 | BENCH(
|
|---|
| 23 | for (size_t i = 0; i < n; i++) {
|
|---|
| 24 | resume( s );
|
|---|
| 25 | },
|
|---|
| 26 | result
|
|---|
| 27 | )
|
|---|
| 28 |
|
|---|
| 29 | printf("%llu\n", result);
|
|---|
| 30 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.