summaryrefslogtreecommitdiff
path: root/utils/testtimer.cc
diff options
context:
space:
mode:
authorchatty2000-11-28 14:19:34 +0000
committerchatty2000-11-28 14:19:34 +0000
commit09f57c8dffd9a8ba0983cce13381aef716f43801 (patch)
tree49c5faa7cd1b76eea36169b5ecce09411b2802c2 /utils/testtimer.cc
parent2575756ec6f41bd05bf4505ccc0253fad0ed77c4 (diff)
downloadivy-league-09f57c8dffd9a8ba0983cce13381aef716f43801.zip
ivy-league-09f57c8dffd9a8ba0983cce13381aef716f43801.tar.gz
ivy-league-09f57c8dffd9a8ba0983cce13381aef716f43801.tar.bz2
ivy-league-09f57c8dffd9a8ba0983cce13381aef716f43801.tar.xz
*** empty log message ***
Diffstat (limited to 'utils/testtimer.cc')
-rw-r--r--utils/testtimer.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/testtimer.cc b/utils/testtimer.cc
new file mode 100644
index 0000000..3dc4b0c
--- /dev/null
+++ b/utils/testtimer.cc
@@ -0,0 +1,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 (;;)
+ ;
+}