LLDB mainline
|
Class used to track the duration of long running tasks related to a single scope for reporting. More...
#include <TaskTimer.h>
Public Member Functions | |
template<typename C > | |
auto | TimeTask (llvm::StringRef name, C task) |
Execute the given task and record its duration. | |
void | ForEachTimedTask (std::function< void(const std::string &name, std::chrono::milliseconds duration)> callback) |
Executive the given callback on each recorded task. | |
Private Attributes | |
std::unordered_map< std::string, std::chrono::milliseconds > | m_timed_tasks |
Class used to track the duration of long running tasks related to a single scope for reporting.
Definition at line 24 of file TaskTimer.h.
void ScopedTaskTimer::ForEachTimedTask | ( | std::function< void(const std::string &name, std::chrono::milliseconds duration)> | callback | ) |
Executive the given callback
on each recorded task.
[in] | callback | The first parameter of the callback is the name of the recorded task, and the second parameter is the duration of that task. |
Definition at line 16 of file TaskTimer.cpp.
References m_timed_tasks.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::DumpTraceInfo(), and lldb_private::trace_intel_pt::TraceIntelPT::DumpTraceInfoAsJson().
|
inline |
Execute the given task
and record its duration.
[in] | name | The name used to identify this task for reporting. |
[in] | task | The task function. |
Definition at line 36 of file TaskTimer.h.
References m_timed_tasks.
Referenced by lldb_private::trace_intel_pt::ThreadDecoder::DoDecode().
|
private |
Definition at line 56 of file TaskTimer.h.
Referenced by ForEachTimedTask(), and TimeTask().