aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-29 09:16:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-29 09:16:53 +0000
commitf20b97abe74cfbb1f28ef70043cf718fbebf4fa4 (patch)
tree818f5beab307c6cb813f4f9721950667bd6df0cf /test
parent6f0569444dafdae8b367a54a07a4bfaf3675f545 (diff)
downloadChibiOS-f20b97abe74cfbb1f28ef70043cf718fbebf4fa4.tar.gz
ChibiOS-f20b97abe74cfbb1f28ef70043cf718fbebf4fa4.tar.bz2
ChibiOS-f20b97abe74cfbb1f28ef70043cf718fbebf4fa4.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@118 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r--test/test.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/test.c b/test/test.c
index 412e46866..7ea1bb89c 100644
--- a/test/test.c
+++ b/test/test.c
@@ -19,7 +19,9 @@
#include <ch.h>
+#if defined(WIN32)
void ChkIntSources(void);
+#endif
#if defined(WIN32) && defined(_DEBUG)
static WorkingArea(wsT1, 512);
@@ -122,6 +124,11 @@ t_msg Thread6(void *p) {
return 0;
}
+t_msg Thread7(void *p) {
+
+ return (unsigned int)p + 1;
+}
+
/**
* Tester thread, this thread must be created with priority \p NORMALPRIO.
*/
@@ -254,9 +261,29 @@ t_msg TestThread(void *p) {
chThdWait(t1);
print("Messages throughput = ");
printn(i);
- print(" msg/S, ");
+ print(" msgs/S, ");
printn(i << 1);
- println(" ctxsw/S");
+ println(" ctxsws/S");
+
+ println("*** Kernel Benchmark, threads creation/termination:");
+ time = chSysGetTime() + 1;
+ while (chSysGetTime() < time) {
+#if defined(WIN32)
+ ChkIntSources();
+#endif
+ }
+ time += 1000;
+ i = 0;
+ while (chSysGetTime() < time) {
+ t1 = chThdCreate(chThdGetPriority()-1, 0, wsT1, sizeof(wsT1), Thread7, (void *)i);
+ i = chThdWait(t1);
+#if defined(WIN32)
+ ChkIntSources();
+#endif
+ }
+ print("Threads throughput = ");
+ printn(i);
+ print(" threads/S");
println("\r\nTest complete");
return 0;