From 8748463f363c0096b6490281bc904edeb8fe3fe2 Mon Sep 17 00:00:00 2001 From: rasky Date: Mon, 4 Oct 2010 18:21:21 +0000 Subject: [PATCH] Add speed calculation to cipher benchmarks git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4399 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/sec/benchmarks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bertos/sec/benchmarks.c b/bertos/sec/benchmarks.c index 92c99089..d0e3cdff 100644 --- a/bertos/sec/benchmarks.c +++ b/bertos/sec/benchmarks.c @@ -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))); } -- 2.25.1