[Lldb-commits] [lldb] r219144 - Make TimeValue support returning the time in milliseconds.
Zachary Turner
zturner at google.com
Mon Oct 6 14:22:48 PDT 2014
Author: zturner
Date: Mon Oct 6 16:22:48 2014
New Revision: 219144
URL: http://llvm.org/viewvc/llvm-project?rev=219144&view=rev
Log:
Make TimeValue support returning the time in milliseconds.
Modified:
lldb/trunk/include/lldb/Host/TimeValue.h
Modified: lldb/trunk/include/lldb/Host/TimeValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/TimeValue.h?rev=219144&r1=219143&r2=219144&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/TimeValue.h (original)
+++ lldb/trunk/include/lldb/Host/TimeValue.h Mon Oct 6 16:22:48 2014
@@ -31,6 +31,7 @@ public:
static const uint64_t MicroSecPerSec = 1000000UL;
static const uint64_t NanoSecPerSec = 1000000000UL;
static const uint64_t NanoSecPerMicroSec = 1000U;
+ static const uint64_t NanoSecPerMilliSec = 1000000UL;
//------------------------------------------------------------------
// Constructors and Destructors
@@ -97,6 +98,15 @@ public:
return (m_nano_seconds % NanoSecPerSec) / NanoSecPerMicroSec;
}
+ /// Returns only the fractional portion of the TimeValue rounded down to the
+ /// nearest millisecond (divide by one million).
+ /// @brief Retrieve the fractional part as milliseconds;
+ uint32_t
+ milliseconds() const
+ {
+ return nanoseconds() / NanoSecPerMilliSec;
+ }
+
protected:
//------------------------------------------------------------------
// Classes that inherit from TimeValue can see and modify these
More information about the lldb-commits
mailing list