mirror of https://github.com/RPCS3/rpcs3.git
rsx: Reduce the performance impact of enabling the profiling timer
- Just use TSC if available
This commit is contained in:
parent
cfecbb24ca
commit
454a724f4e
|
@ -1,13 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
#include <util/types.hpp>
|
||||
#include "time.hpp"
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
struct profiling_timer
|
||||
{
|
||||
bool enabled = false;
|
||||
steady_clock::time_point last;
|
||||
u64 last;
|
||||
|
||||
profiling_timer() = default;
|
||||
|
||||
|
@ -15,7 +16,7 @@ namespace rsx
|
|||
{
|
||||
if (enabled) [[unlikely]]
|
||||
{
|
||||
last = steady_clock::now();
|
||||
last = rsx::uclock();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,8 +28,8 @@ namespace rsx
|
|||
}
|
||||
|
||||
auto old = last;
|
||||
last = steady_clock::now();
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(last - old).count();
|
||||
last = rsx::uclock();
|
||||
return static_cast<s64>(last - old);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue