summaryrefslogtreecommitdiffstats
path: root/botan/checks/bench.h
blob: 07d67e0d1d0dd40a240c5c7a1e1bea803b4b9068 (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&,
               bool html, double seconds);

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

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

#endif