aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-12-01 18:07:55 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2012-12-05 23:06:01 +0100
commit0ae0712b1c00352d926e0c9a72d97377c472301c (patch)
treec762e015eac22701b5be04801e745900f8a50597 /src/util.h
parenta485c1b69e282883414dfb387d0aac1cfa21533d (diff)
Add GetTimeMicros() for ore accurate benchmarking
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index ada0dd3790..1ed5c30aae 100644
--- a/src/util.h
+++ b/src/util.h
@@ -330,6 +330,12 @@ inline int64 GetTimeMillis()
boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds();
}
+inline int64 GetTimeMicros()
+{
+ return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) -
+ boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds();
+}
+
inline std::string DateTimeStrFormat(const char* pszFormat, int64 nTime)
{
time_t n = nTime;