rpcsx/rpcs3/Emu/RSX/Common/time.hpp
kd-11 cfecbb24ca rsx: Avoid calling slow functions every draw call
- Use TSC for timing where interval duration matters.
- Use atomic counter for ordering timestamps otherwise.
2022-03-08 22:06:26 +03:00

22 lines
316 B
C++

#pragma once
#include <util/asm.hpp>
#include <util/sysinfo.hpp>
extern u64 get_system_time();
namespace rsx
{
static inline u64 uclock()
{
if (const u64 freq = (utils::get_tsc_freq() / 1000000))
{
return utils::get_tsc() / freq;
}
else
{
return get_system_time();
}
}
}