1 #include "benchmarks.h"
6 void hash_benchmark(Hash *h, const char *hname, int numk)
8 static uint8_t buf[512];
9 memset(buf, 0x12, sizeof(buf));
11 ticks_t t = timer_clock();
13 for (int j=0;j<64;++j) {
15 for (int i=0; i<numk*2; ++i)
16 hash_update(h, buf, 512);
20 t = timer_clock() - t;
22 utime_t usec = ticks_to_us(t) / 64;
23 kprintf("%s @ %ldMhz: %s of %dKiB of data: %lu.%lu ms\n", CPU_CORE_NAME, CPU_FREQ/1000000, hname, numk, (usec/1000), (usec % 1000));