Ignore:
Timestamp:
Oct 26, 2017, 12:16:10 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
6395817
Parents:
4149d9d
Message:

Updated the creation and ctxswitch benchmark to all be consistent and flexible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/ctxswitch/upp_cor.cc

    r4149d9d rb7170a64  
     1#include <cstdio>
     2
     3#include "bench.h"
     4
     5_Coroutine GreatSuspender {
     6public:
     7        GreatSuspender() {
     8                resume();
     9        }
     10
     11        void do_resume() {
     12                resume();
     13        }
     14private:
     15        void main() {
     16                while( true ) {
     17                        suspend();
     18                }
     19        }
     20};
     21
     22int main(int argc, char* argv[]) {
     23        GreatSuspender s;
     24
     25        BENCH(
     26                for (size_t i = 0; i < n; i++) {
     27                        s.do_resume();
     28                },
     29                result
     30        )
     31
     32        printf("%llu\n", result);
     33}
Note: See TracChangeset for help on using the changeset viewer.