You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
570 B

#include <benchmark/benchmark.h>
#include "md5.h"
std::string test_data() {
char data[64];
for (char i = 0; i < 64; ++i) {
data[i] = i;
}
return {data, data + 64};
}
static void MD5_Update(benchmark::State &state) {
const auto data = test_data();
md5::MD5 kk;
for (auto _ : state) {
kk.Update(data.c_str(), 64);
}
}
static void MD5_Digest(benchmark::State &state) {
md5::MD5 kk;
for (auto _ : state) {
auto pp = kk.Digest();
}
}
BENCHMARK(MD5_Update);
BENCHMARK(MD5_Digest);
BENCHMARK_MAIN();