Skip to content
Snippets Groups Projects
Select Git revision
  • de3c9eda959c67949ea043af40706ed7c07b4aa3
  • master default protected
  • refactoring
  • push_test
  • qpong_opengl
  • push_to_gitlab
  • feature_imgui_opengl
  • feature_google_test_integration
  • feature_config
  • merge_ci_and_googletest
  • feature_pixbuf
  • feature_heapBuffer
12 results

Profiler.hpp

Blame
  • 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