source: src/benchmark/Monitor.c @ 8cb6fcd

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 8cb6fcd was 8cb6fcd, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Refactored common code into bench.h

  • Property mode set to 100644
File size: 362 bytes
Line 
1#include <fstream>
2#include <stdlib>
3#include <thread>
4
5#include "bench.h"
6
7monitor mon_t {};
8
9mon_t mon1, mon2;
10
11void dummy( mon_t * mutex a, mon_t * mutex b ) {}
12
13
14
15int main() {
16        long long int StartTime, EndTime;
17
18        StartTime = Time();
19        for( int i = 0; i < N; i++ ) {
20                dummy( &mon1, &mon2 );
21        }
22        EndTime = Time();
23
24        sout | ( EndTime - StartTime ) / N | endl;
25}
Note: See TracBrowser for help on using the repository browser.