mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-03-05 21:14:05 +01:00
- Use TSC for timing where interval duration matters. - Use atomic counter for ordering timestamps otherwise.
22 lines
316 B
C++
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();
|
|
}
|
|
}
|
|
}
|