summaryrefslogtreecommitdiff
path: root/hrtimer.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-19 17:09:07 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-19 17:09:07 +0000
commitab1ed4b45d7c6ea11785065027986d389e5b673a (patch)
tree7e300cb2827b1bf3cc05695e5e89b5ef58b1be93 /hrtimer.h
parentb0034a8989f961db2fcfb7673e487031e3115cb5 (diff)
downloadcryptopp-ab1ed4b45d7c6ea11785065027986d389e5b673a.tar.gz
sync with private branch
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@81 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 d05dfd1..1e51392 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: