diff options
author | lloyd <[email protected]> | 2009-12-01 12:00:48 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-01 12:00:48 +0000 |
commit | 874dbb8323dd4d7eff3ff16cff0cfafc16ddbfa7 (patch) | |
tree | bc3a84c43c5924119972f24da3af89317694f0cb /src/benchmark/benchmark.h | |
parent | 78f5726220b637cd8ae117bbcf8ff8d6c8dfeaed (diff) |
Consolidate the non-canonical epoch timers, like cpuid and Win32's
QueryPerformanceCounter, into an entropy source hres_timer. Its
results, if any, do not count as contributing entropy to the poll.
Convert the other (monotonic/fixed epoch) timers to a single function
get_nanoseconds_clock(), living in time.h, which statically chooses
the 'best' timer type (clock_gettime, gettimeofday, std::clock, in
that order depending on what is available). Add feature test macros
for clock_gettime and gettimeofday.
Remove the Timer class and timer.h. Remove the Timer& argument to the
algorithm benchmark function.
Diffstat (limited to 'src/benchmark/benchmark.h')
-rw-r--r-- | src/benchmark/benchmark.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/benchmark/benchmark.h b/src/benchmark/benchmark.h index 1b2730105..9c4e410f1 100644 --- a/src/benchmark/benchmark.h +++ b/src/benchmark/benchmark.h @@ -9,40 +9,16 @@ #define BOTAN_RUNTIME_BENCHMARK_H__ #include <botan/algo_factory.h> -#include <botan/timer.h> #include <botan/rng.h> #include <map> #include <string> -/** -* Choose some sort of default timer implementation to use, since some -* (like hardware tick counters and current Win32 timer) are not -* reliable for benchmarking. -*/ -#if defined(BOTAN_HAS_TIMER_POSIX) - #include <botan/tm_posix.h> -#elif defined(BOTAN_HAS_TIMER_UNIX) - #include <botan/tm_unix.h> -#endif - namespace Botan { -#if defined(BOTAN_HAS_TIMER_POSIX) - typedef POSIX_Timer Default_Benchmark_Timer; -#elif defined(BOTAN_HAS_TIMER_UNIX) - typedef Unix_Timer Default_Benchmark_Timer; -#else - /* I have not had good success using clock(), the results seem - * pretty bogus, but as a last resort it works. - */ - typedef ANSI_Clock_Timer Default_Benchmark_Timer; -#endif - /** * Algorithm benchmark * @param name the name of the algorithm to test (cipher, hash, or MAC) * @param milliseconds total time for the benchmark to run -* @param timer the timer to use * @param rng the rng to use to generate random inputs * @param af the algorithm factory used to create objects * @return results a map from provider to speed in mebibytes per second @@ -50,7 +26,6 @@ namespace Botan { std::map<std::string, double> BOTAN_DLL algorithm_benchmark(const std::string& name, u32bit milliseconds, - Timer& timer, RandomNumberGenerator& rng, Algorithm_Factory& af); |