aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/benchmark/benchmark.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-19 23:33:06 +0000
committerlloyd <[email protected]>2015-02-19 23:33:06 +0000
commit368e23ad2eacfc0c230c48f12a6d4d2072881afc (patch)
treea3d26d007bb7db9072e19ffa3ccee88ca421d4cd /src/lib/misc/benchmark/benchmark.h
parentaa4b1ae32e96429a18c7d53a50febc4fa0e6f124 (diff)
Move
Diffstat (limited to 'src/lib/misc/benchmark/benchmark.h')
-rw-r--r--src/lib/misc/benchmark/benchmark.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/misc/benchmark/benchmark.h b/src/lib/misc/benchmark/benchmark.h
new file mode 100644
index 000000000..3fa020e1b
--- /dev/null
+++ b/src/lib/misc/benchmark/benchmark.h
@@ -0,0 +1,35 @@
+/*
+* Runtime benchmarking
+* (C) 2008-2009 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_RUNTIME_BENCHMARK_H__
+#define BOTAN_RUNTIME_BENCHMARK_H__
+
+#include <botan/rng.h>
+#include <map>
+#include <string>
+#include <chrono>
+
+namespace Botan {
+
+/**
+* Algorithm benchmark
+* @param name the name of the algorithm to test (cipher, hash, or MAC)
+* @param af the algorithm factory used to create objects
+* @param rng the rng to use to generate random inputs
+* @param milliseconds total time for the benchmark to run
+* @param buf_size size of buffer to benchmark against, in KiB
+* @return results a map from provider to speed in mebibytes per second
+*/
+std::map<std::string, double>
+BOTAN_DLL algorithm_benchmark(const std::string& name,
+ RandomNumberGenerator& rng,
+ std::chrono::milliseconds milliseconds,
+ size_t buf_size);
+
+}
+
+#endif