diff options
author | Virgile Bello <virgile.bello@gmail.com> | 2013-09-04 13:56:11 +0000 |
---|---|---|
committer | Virgile Bello <virgile.bello@gmail.com> | 2013-09-04 13:56:11 +0000 |
commit | 0a3b151fdffacd5ac1910ad144ede6278e84719e (patch) | |
tree | 2b6fc8a133d5a05873062a605d82ea9c52169016 /lldb/source/Host/common/TimeValue.cpp | |
parent | f017dc0156a0293ae923f11378fdfd5ff4103d18 (diff) | |
download | bcm5719-llvm-0a3b151fdffacd5ac1910ad144ede6278e84719e.tar.gz bcm5719-llvm-0a3b151fdffacd5ac1910ad144ede6278e84719e.zip |
Remove <windows.h> from lldb-types.h.
llvm-svn: 189934
Diffstat (limited to 'lldb/source/Host/common/TimeValue.cpp')
-rw-r--r-- | lldb/source/Host/common/TimeValue.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lldb/source/Host/common/TimeValue.cpp b/lldb/source/Host/common/TimeValue.cpp index 0858255cc45..5debd9eade4 100644 --- a/lldb/source/Host/common/TimeValue.cpp +++ b/lldb/source/Host/common/TimeValue.cpp @@ -43,8 +43,8 @@ TimeValue::TimeValue(const struct timespec& ts) : { } -TimeValue::TimeValue(const struct timeval& tv) : - m_nano_seconds ((uint64_t) tv.tv_sec * NanoSecPerSec + (uint64_t) tv.tv_usec * NanoSecPerMicroSec) +TimeValue::TimeValue(uint32_t seconds, uint32_t nanos) : + m_nano_seconds((uint64_t) seconds * NanoSecPerSec + nanos) { } @@ -85,15 +85,6 @@ TimeValue::GetAsTimeSpec () const return ts; } -struct timeval -TimeValue::GetAsTimeVal () const -{ - struct timeval tv; - tv.tv_sec = m_nano_seconds / NanoSecPerSec; - tv.tv_usec = (m_nano_seconds % NanoSecPerSec) / NanoSecPerMicroSec; - return tv; -} - void TimeValue::Clear () { @@ -127,9 +118,12 @@ TimeValue::OffsetWithNanoSeconds (uint64_t nsec) TimeValue TimeValue::Now() { + uint32_t seconds, nanoseconds; struct timeval tv; gettimeofday(&tv, NULL); - TimeValue now(tv); + seconds = tv.tv_sec; + nanoseconds = tv.tv_usec * NanoSecPerMicroSec; + TimeValue now(seconds, nanoseconds); return now; } |