From: rasky Date: Mon, 4 Oct 2010 18:21:21 +0000 (+0000) Subject: Add speed calculation to cipher benchmarks X-Git-Tag: 2.6.0~5^2~121 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8748463f363c0096b6490281bc904edeb8fe3fe2;p=bertos.git Add speed calculation to cipher benchmarks git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4399 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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))); }