diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-11-02 12:43:53 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-11-02 12:43:53 +0000 |
commit | aac96ddde3e160390b4f810f852adff0fb97913b (patch) | |
tree | a61ce2154a3ef76e2132c4281befb8a3b86f9f90 /test/testbmk.c | |
parent | bdba36fefcfd30a7bf5d07803363cdc634a62c5a (diff) | |
download | ChibiOS-aac96ddde3e160390b4f810f852adff0fb97913b.tar.gz ChibiOS-aac96ddde3e160390b4f810f852adff0fb97913b.tar.bz2 ChibiOS-aac96ddde3e160390b4f810f852adff0fb97913b.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@492 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/testbmk.c')
-rw-r--r-- | test/testbmk.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/testbmk.c b/test/testbmk.c index acdfa50e8..02b810e1f 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -292,3 +292,40 @@ const struct testcase testbmk7 = { empty,
bmk7_execute
};
+
+static char *bmk8_gettest(void) {
+
+ return "Benchmark, virtual timers set/reset";
+}
+
+static void tmo(void *param) {}
+
+static void bmk8_execute(void) {
+ static VirtualTimer vt1, vt2;
+ uint32_t n = 0;
+
+ test_wait_tick();
+ test_start_timer(1000);
+ do {
+ chSysLock();
+ chVTSetI(&vt1, 1, tmo, NULL);
+ chVTSetI(&vt2, 10000, tmo, NULL);
+ chVTResetI(&vt1);
+ chVTResetI(&vt2);
+ chSysUnlock();
+ n++;
+#if defined(WIN32)
+ ChkIntSources();
+#endif
+ } while (!test_timer_done);
+ test_print("--- Score : ");
+ test_printn(n * 2);
+ test_println(" timers/S");
+}
+
+const struct testcase testbmk8 = {
+ bmk8_gettest,
+ empty,
+ empty,
+ bmk8_execute
+};
|