summaryrefslogtreecommitdiff
path: root/utils/testtimer.cc
blob: 231b65cd67b271c5895bfd217d3713a85f6d1d2c (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
43
#include "Timer.h"
#include <stdio.h>
#include <stdlib.h>

int foo_counter = 0;

void
foo (Millisecond)
{
	IvlTimeStamp t;
	fprintf (stderr, "tic %d\n", (unsigned long) (t));
	foo_counter++;
}

void
baz (Millisecond)
{
	IvlTimeStamp t;
	fprintf (stderr, "tac %d\n", (unsigned long) (t));
}

void
bar (Millisecond)
{
	printf ("%d\n", foo_counter);
//	exit (0);
}

IvlList l;

main ()
{
#if 1
	IvlTimer t (1000, foo, 5);
	IvlTimer s (1000, baz);
	IvlTimer tt (10000, bar);
#else
	IvlTimer t (20, foo);
	IvlTimer tt (10000, bar);
#endif
	for (;;)
		;
}