From aac96ddde3e160390b4f810f852adff0fb97913b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 2 Nov 2008 12:43:53 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@492 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 3 +++ test/test.c | 1 + test/testbmk.c | 37 +++++++++++++++++++++++++++++++++++++ test/testbmk.h | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 19686f5dd..96eb77bdd 100644 --- a/readme.txt +++ b/readme.txt @@ -73,6 +73,9 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, *** Releases *** ***************************************************************************** +*** 0.7.4 *** +- Added a new benchmark to the test suite (timers set/reset performance). + *** 0.7.3 *** - FIX: Fixed a bug in chThdSleepUntil(), this API is no more a macro now. - NEW: New chThdSleepSeconds(), chThdSleepMilliseconds() and diff --git a/test/test.c b/test/test.c index 9510eb39d..667b89749 100644 --- a/test/test.c +++ b/test/test.c @@ -62,6 +62,7 @@ static const struct testcase *tests[] = { &testbmk5, &testbmk6, &testbmk7, + &testbmk8, NULL }; 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 +}; diff --git a/test/testbmk.h b/test/testbmk.h index 5e99dc3d5..afa3381e4 100644 --- a/test/testbmk.h +++ b/test/testbmk.h @@ -22,6 +22,6 @@ extern const struct testcase testbmk1, testbmk2, testbmk3, testbmk4, testbmk5, testbmk6, - testbmk7; + testbmk7, testbmk8; #endif /* _TESTBMK_H_ */