summaryrefslogtreecommitdiff
path: root/utils/testtimer.cc
blob: 3dc4b0cd18f3f2327acc420491e23d455fd30c38 (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)
{
	CcuTimeStamp t;
	fprintf (stderr, "tic %d\n", (unsigned long) (t));
	foo_counter++;
}

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

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

CcuList l;

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