Select Git revision
Profiler.hpp

Armin Co authored
Profiler.hpp 664 B
///
/// @file Profiler.hpp
/// @author Armin Co
///
/// @brief Class to do some basic timing and profiling.
///
#ifndef QPONG_PROFILER_HPP
#define QPONG_PROFILER_HPP
#include <chrono>
#include <iostream>
enum class Verbose
{
True,
False
};
/// @brief Profiler class to do some basic timings.
///
class Profiler
{
public:
Profiler(const char* name);
~Profiler();
/// @brief Stops the timing and returns the time measured in nanoseconds.
///
long stop();
private:
const char* m_name;
Verbose m_verbose;
std::chrono::time_point<std::chrono::system_clock> m_startTimepoint;
bool m_stopped;
};
#endif