source: src/benchmark/PthrdCtxSwitch.c @ d67cdb7

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since d67cdb7 was d67cdb7, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

merge

  • Property mode set to 100644
File size: 368 bytes
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#define _GNU_SOURCE
4#include <pthread.h>
5
6#include "bench.h"
7
8int main() {
9        const unsigned int NoOfTimes = N;
10        long long int StartTime, EndTime;
11
12        StartTime = Time();
13        for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) {
14                pthread_yield();
15        }
16        EndTime = Time();
17
18        printf("%lld\n", ( EndTime - StartTime ) / NoOfTimes );
19}
Note: See TracBrowser for help on using the repository browser.