aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/sandbox/example.c
blob: 2b8fc8c58c516f3dce3c71cebff0c78629b8d297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdio.h>
#include "f.h"
#include "../cycles.h"

#if 0
int main(void){
  cycle_count_config();

  int i;
  int S = 0;

  TIMEINIT
  for (i = 0; i < 1000; i++){
    S += f(i, i*2);
  }
  TIMESTOP(0)

  printf("Final value: %d\n", S);
  TIMESTOP(1)

  TIMEPRINT(1)
  return 0;
}
#endif

#if 0
int main(void){
  cycle_count_config();

  TIMEINIT
  int a = 42;
  int b = 21;
  int c = 42+b;
  TIMESTOP(0)
  int d = a + b;
  int e = a + b + c + d;
  TIMESTOP(1)

  TIMEPRINT(1)
  return e;
}
#endif