Add speed calculation to cipher benchmarks
authorrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 4 Oct 2010 18:21:21 +0000 (18:21 +0000)
committerrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 4 Oct 2010 18:21:21 +0000 (18:21 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4399 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/sec/benchmarks.c

index 92c99089364658bb036e894b04ad8b78fbec16fd..d0e3cdfffaf8aaacc21d34c47c7508a41c10af10 100644 (file)
@@ -72,8 +72,9 @@ void cipher_benchmark(BlockCipher *c, const char *cname, int numbytes)
        t = timer_clock() - t;
 
        utime_t usec = ticks_to_us(t) / CYCLES;
-       kprintf("%s @ %ldMhz: Encryption with %s-CBC of %d bytes: %lu.%lu ms\n",
+       kprintf("%s @ %ldMhz: %s-CBC of %d bytes: %lu.%lu ms (%d KiB/s)\n",
                        CPU_CORE_NAME, CPU_FREQ/1000000,
                        cname, numbytes,
-                       (usec/1000), (usec % 1000));
+                       (usec/1000), (usec % 1000),
+                       (uint32_t)(numbytes * (CYCLES * 1000000 / 1024) / ticks_to_us(t)));
 }