aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer/timer.h
blob: dfa04ee3af2b10fc482ce019799a746d230bf054 (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
38
39
40
/**
* Timestamp Functions Header File
* (C) 1999-2008 Jack Lloyd
*/

#ifndef BOTAN_TIMERS_H__
#define BOTAN_TIMERS_H__

#include <botan/rng.h>

namespace Botan {

/**
* Timer Interface
*/
class BOTAN_DLL Timer : public EntropySource
   {
   public:
      virtual u64bit clock() const = 0;
      u32bit slow_poll(byte[], u32bit);
      u32bit fast_poll(byte[], u32bit);

      virtual ~Timer() {}
   protected:
      static u64bit combine_timers(u32bit, u32bit, u32bit);
   };

/**
* ANSI Clock Timer
*/
class BOTAN_DLL ANSI_Clock_Timer : public Timer
   {
   public:
      std::string name() const { return "ANSI clock"; }
      u64bit clock() const;
   };

}

#endif