source: benchmark/Monitor.c @ 107b01a

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resnenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 107b01a was 200fcb3, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

add auto newline to sout, change endl to nl

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