1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Fix thread_base::get_cycles (Linux/POSIX)

This commit is contained in:
Nekotekina 2018-10-11 13:57:43 +03:00
parent 430e2243ac
commit 8ca6c9fff0

View File

@ -1880,8 +1880,9 @@ u64 thread_base::get_cycles()
if (QueryThreadCycleTime((HANDLE)m_thread.load(), &cycles))
{
#else
clockid_t _clock;
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;
#endif