mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Profiler: Sort output by total time
This commit is contained in:
@ -5,10 +5,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include "CommonTypes.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
class Profiler
|
||||
{
|
||||
public:
|
||||
@ -21,8 +25,11 @@ public:
|
||||
void Stop();
|
||||
std::string Read();
|
||||
|
||||
bool operator<(const Profiler& b) const;
|
||||
|
||||
private:
|
||||
static std::list<Profiler*> s_all_profilers;
|
||||
static std::mutex s_mutex;
|
||||
static u32 s_max_length;
|
||||
static u64 s_frame_time;
|
||||
static u64 s_usecs_frame;
|
||||
@ -55,5 +62,7 @@ private:
|
||||
Profiler* m_p;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
// Warning: This profiler isn't thread safe. Only profile functions which doesn't run simultaneously
|
||||
#define PROFILE(name) static Profiler prof_gen(name); ProfilerExecuter prof_e(&prof_gen);
|
||||
#define PROFILE(name) static Common::Profiler prof_gen(name); Common::ProfilerExecuter prof_e(&prof_gen);
|
||||
|
Reference in New Issue
Block a user