mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 16:55:58 +00:00
37 lines
551 B
C++
37 lines
551 B
C++
/*
|
|
* profile.hpp
|
|
*
|
|
* Created on: May 22, 2024
|
|
* Author: Dario
|
|
*/
|
|
|
|
#ifndef STA_DEBUGGING_PROFILING_HPP
|
|
#define STA_DEBUGGING_PROFILING_HPP
|
|
|
|
#include <sta/debug/debug.hpp>
|
|
#ifdef STA_DEBUGGING_ENABLED
|
|
|
|
namespace sta
|
|
{
|
|
class Profiler {
|
|
public:
|
|
Profiler(const char* name);
|
|
|
|
~Profiler();
|
|
private:
|
|
const char* name_;
|
|
uint32_t start_;
|
|
};
|
|
} // namespace sta
|
|
|
|
/**
|
|
*
|
|
*/
|
|
#define STA_TIME_IT(name) sta::Profiler profiler(name);
|
|
|
|
#endif // STA_DEBUGGING_ENABLED
|
|
|
|
#define STA_TIME_IT(name) ((void)0)
|
|
|
|
#endif // STA_DEBUGGING_PROFILING_HPP
|