|
VLink 2.0.0
A high-performance communication middleware
|
RAII guard that automatically calls CpuProfiler::begin() and CpuProfiler::end(). More...
#include "./macros.h"Go to the source code of this file.
Classes | |
| class | vlink::CpuProfilerGuard |
RAII scope guard that brackets a CpuProfiler active interval. More... | |
Namespaces | |
| namespace | vlink |
RAII guard that automatically calls CpuProfiler::begin() and CpuProfiler::end().
CpuProfilerGuard is a lightweight RAII wrapper that calls CpuProfiler::begin() in its constructor and CpuProfiler::end() in its destructor. This ensures the active interval is always closed, even if an exception is thrown.
nullptr as the profiler pointer is safe; both constructor and destructor check for nullptr before calling any method.CpuProfiler::is_global_enabled() to skip guard construction when profiling is disabled globally, reducing overhead in hot paths.