20#include "absl/strings/str_cat.h"
25#if defined(__GNUC__) || defined(__GNUG__)
26#define AFUNC __PRETTY_FUNCTION__
27#elif defined(__clang__)
28#define AFUNC __PRETTY_FUNCTION__
68 const std::string& indicator =
"");
81 int64_t
End(
const std::string& msg);
107#if defined(ENABLE_PERF)
108#define PERF_FUNCTION() \
109 apollo::common::util::TimerWrapper _timer_wrapper_( \
110 apollo::common::util::function_signature(AFUNC))
111#define PERF_FUNCTION_WITH_NAME(func_name) \
112 apollo::common::util::TimerWrapper _timer_wrapper_(func_name)
113#define PERF_FUNCTION_WITH_INDICATOR(indicator) \
114 apollo::common::util::TimerWrapper _timer_wrapper_( \
115 apollo::common::util::function_signature(AFUNC, indicator))
116#define PERF_BLOCK_START() \
117 apollo::common::util::Timer _timer_; \
119#define PERF_BLOCK_END(msg) _timer_.End(msg)
120#define PERF_BLOCK_END_WITH_INDICATOR(indicator, msg) \
121 _timer_.End(absl::StrCat(indicator, "_", msg))
123#define PERF_FUNCTION()
124#define PERF_FUNCTION_WITH_NAME(func_name) UNUSED(func_name);
125#define PERF_FUNCTION_WITH_INDICATOR(indicator) UNUSED(indicator);
126#define PERF_BLOCK_START()
127#define PERF_BLOCK_END(msg) UNUSED(msg);
128#define PERF_BLOCK_END_WITH_INDICATOR(indicator, msg) \
TimerWrapper(const std::string &msg)
int64_t End(const std::string &msg)
Cyber has builtin time type Time.
#define DISALLOW_COPY_AND_ASSIGN(classname)
std::string function_signature(const std::string &func_name, const std::string &indicator)