summaryrefslogtreecommitdiff
path: root/hrtimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'hrtimer.h')
-rw-r--r--hrtimer.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/hrtimer.h b/hrtimer.h
index 03c4310..6bb8301 100644
--- a/hrtimer.h
+++ b/hrtimer.h
@@ -5,14 +5,19 @@
NAMESPACE_BEGIN(CryptoPP)
-#ifdef WORD64_AVAILABLE
- typedef word64 TimerWord;
+#ifdef HIGHRES_TIMER_AVAILABLE
+ #ifdef WORD64_AVAILABLE
+ typedef word64 TimerWord;
+ #else
+ typedef word32 TimerWord;
+ #endif
#else
- typedef word32 TimerWord;
+ #include <time.h>
+ typedef clock_t TimerWord;
#endif
//! _
-class TimerBase
+class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TimerBase
{
public:
enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS};
@@ -44,10 +49,8 @@ public:
TimerWord TicksPerSecond();
};
-#ifdef HIGHRES_TIMER_AVAILABLE
-
//! high resolution timer
-class Timer : public TimerBase
+class CRYPTOPP_DLL Timer : public TimerBase
{
public:
Timer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {}
@@ -55,8 +58,6 @@ public:
TimerWord TicksPerSecond();
};
-#endif // HIGHRES_TIMER_AVAILABLE
-
NAMESPACE_END
#endif