mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
Fix thread_base::get_cycles (Linux/POSIX)
This commit is contained in:
parent
430e2243ac
commit
8ca6c9fff0
@ -1880,8 +1880,9 @@ u64 thread_base::get_cycles()
|
|||||||
if (QueryThreadCycleTime((HANDLE)m_thread.load(), &cycles))
|
if (QueryThreadCycleTime((HANDLE)m_thread.load(), &cycles))
|
||||||
{
|
{
|
||||||
#else
|
#else
|
||||||
|
clockid_t _clock;
|
||||||
struct timespec thread_time;
|
struct timespec thread_time;
|
||||||
if (!clock_gettime(CLOCK_THREAD_CPUTIME_ID, &thread_time))
|
if (!pthread_getcpuclockid((pthread_t)m_thread.load(), &_clock) && !clock_gettime(_clock, &thread_time))
|
||||||
{
|
{
|
||||||
cycles = static_cast<u64>(thread_time.tv_sec) * 1'000'000'000 + thread_time.tv_nsec;
|
cycles = static_cast<u64>(thread_time.tv_sec) * 1'000'000'000 + thread_time.tv_nsec;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user