[Lldb-commits] [PATCH] D25393: Remove IntervalTimer class
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 19 08:10:35 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL284599: Remove IntervalTimer class (authored by labath).
Changed prior to commit:
https://reviews.llvm.org/D25393?vs=74015&id=75153#toc
Repository:
rL LLVM
https://reviews.llvm.org/D25393
Files:
lldb/trunk/include/lldb/Core/Timer.h
Index: lldb/trunk/include/lldb/Core/Timer.h
===================================================================
--- lldb/trunk/include/lldb/Core/Timer.h
+++ lldb/trunk/include/lldb/Core/Timer.h
@@ -85,47 +85,6 @@
DISALLOW_COPY_AND_ASSIGN(Timer);
};
-class IntervalTimer {
-public:
- IntervalTimer() : m_start(TimeValue::Now()) {}
-
- ~IntervalTimer() = default;
-
- uint64_t GetElapsedNanoSeconds() const { return TimeValue::Now() - m_start; }
-
- void Reset() { m_start = TimeValue::Now(); }
-
- int PrintfElapsed(const char *format, ...)
- __attribute__((format(printf, 2, 3))) {
- TimeValue now(TimeValue::Now());
- const uint64_t elapsed_nsec = now - m_start;
- const char *unit = nullptr;
- float elapsed_value;
- if (elapsed_nsec < 1000) {
- unit = "ns";
- elapsed_value = (float)elapsed_nsec;
- } else if (elapsed_nsec < 1000000) {
- unit = "us";
- elapsed_value = (float)elapsed_nsec / 1000.0f;
- } else if (elapsed_nsec < 1000000000) {
- unit = "ms";
- elapsed_value = (float)elapsed_nsec / 1000000.0f;
- } else {
- unit = "sec";
- elapsed_value = (float)elapsed_nsec / 1000000000.0f;
- }
- int result = printf("%3.2f %s: ", elapsed_value, unit);
- va_list args;
- va_start(args, format);
- result += vprintf(format, args);
- va_end(args);
- return result;
- }
-
-protected:
- TimeValue m_start;
-};
-
} // namespace lldb_private
#endif // liblldb_Timer_h_
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25393.75153.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161019/374100e4/attachment.bin>
More information about the lldb-commits
mailing list