aboutsummaryrefslogtreecommitdiffstats
path: root/checks/bench.h
blob: 0cc3f46d1770a85771a4c5d3b3130b3c71a1582c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#ifndef BOTAN_BENCHMARCH_H__
#define BOTAN_BENCHMARCH_H__

#include <botan/rng.h>
#include <string>
#include <map>
#include <set>
#include "timer.h"

#include <iostream>

class Benchmark_Report
   {
   public:
      void report(const std::string& name, Timer timer)
         {
         std::cout << name << " " << timer << std::endl;
         data[name].insert(timer);
         }

   private:
      std::map<std::string, std::set<Timer> > data;
   };


void benchmark(const std::string&, Botan::RandomNumberGenerator&,
               double seconds);

void bench_pk(Botan::RandomNumberGenerator&,
              const std::string&, double seconds);

u32bit bench_algo(const std::string&,
                  Botan::RandomNumberGenerator&,
                  double);

#endif