mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-12 01:25:59 +00:00
30 lines
423 B
C++
30 lines
423 B
C++
/*
|
|
* profiler.cpp
|
|
*
|
|
* Created on: May 22, 2024
|
|
* Author: Dario
|
|
*/
|
|
|
|
#include <sta/debug/profile.hpp>
|
|
|
|
#ifdef STA_PROFILING_ENABLED
|
|
|
|
#include <sta/time.hpp>
|
|
|
|
namespace sta
|
|
{
|
|
Profiler::Profiler(const char* name)
|
|
: name_{name},
|
|
start_{timeUs()}
|
|
{
|
|
|
|
}
|
|
|
|
Profiler::~Profiler()
|
|
{
|
|
STA_DEBUG_PRINTF(">[PROFILER] %s took %d us", name_, timeUs() - start_);
|
|
}
|
|
} // namespace sta
|
|
|
|
#endif // STA_PROFILING_ENABLED
|