OGL Engine 1.2.0-dev
Loading...
Searching...
No Matches
profiler.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <chrono>
8#include <iostream>
9#include <string>
10#include <unordered_map>
11
12namespace Engine::Core {
13 class Profiler {
14 private:
15 using Clock = std::chrono::high_resolution_clock;
16 using TimePoint = Clock::time_point;
17
18 struct ProfileData {
19 double totalTime = 0.0;
20 int count = 0;
21 };
22
23 std::unordered_map<std::string, ProfileData> data;
24 TimePoint startTime;
25 std::string currentSection;
26
27 public:
33 void Start(const std::string& sectionName);
34
39 void End();
40
45 void Report() const;
46
51 void Reset();
52 };
53}
Definition profiler.hpp:13
void Report() const
Print dans la console les résultats du profiling pour toutes les sections enregistrées.
Definition profiler.cpp:18
void End()
Met fin à la session de profiling en cours.
Definition profiler.cpp:11
void Reset()
Réinitialise le profiler.
Definition profiler.cpp:25
void Start(const std::string &sectionName)
Démarre une analyse d'éxecution avec le profiler.
Definition profiler.cpp:6
Definition event.cpp:3