summaryrefslogtreecommitdiff
path: root/hrtimer.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-06-19 17:09:07 +0000
committerweidai <weidai11@users.noreply.github.com>2003-06-19 17:09:07 +0000
commit376fe5b4ae1607f4158e16bc4ace6e5b5b01154e (patch)
tree7e300cb2827b1bf3cc05695e5e89b5ef58b1be93 /hrtimer.h
parent5b25f4b45fb67c48df4dd576f3271fe00e30796b (diff)
downloadcryptopp-git-376fe5b4ae1607f4158e16bc4ace6e5b5b01154e.tar.gz
sync with private branch
Diffstat (limited to 'hrtimer.h')
-rw-r--r--hrtimer.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/hrtimer.h b/hrtimer.h
index d05dfd10..1e513923 100644
--- a/hrtimer.h
+++ b/hrtimer.h
@@ -11,23 +11,16 @@ NAMESPACE_BEGIN(CryptoPP)
class Timer
{
public:
- enum Unit {SECONDS, MILLISECONDS, MICROSECONDS};
+ enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS};
Timer(Unit unit, bool stuckAtZero = false) : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(false) {}
static word64 GetCurrentTimerValue(); // GetCurrentTime is a macro in MSVC 6.0
- static unsigned long ConvertTo(word64 t, Unit unit);
-
- // this is not the resolution, just a conversion factor into milliseconds
- static inline unsigned int TicksPerMillisecond()
- {
-#if defined(CRYPTOPP_WIN32_AVAILABLE)
- return 10000;
-#elif defined(CRYPTOPP_UNIX_AVAILABLE) || defined(macintosh)
- return 1000;
-#endif
- }
+ static word64 ConvertTo(word64 t, Unit unit);
+ // this is not the resolution, just a conversion factor into seconds
+ static word64 TicksPerSecond();
void StartTimer();
+ word64 ElapsedTimeInWord64();
unsigned long ElapsedTime();
private: