mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-05-07 13:37:46 +00:00
Merge c17fad4ddb into 814821d760
This commit is contained in:
commit
f8149e5bc8
1 changed files with 9 additions and 3 deletions
|
|
@ -854,17 +854,23 @@ static const bool s_tsc_freq_evaluated = []() -> bool
|
|||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER freq;
|
||||
LARGE_INTEGER freq{};
|
||||
if (!QueryPerformanceFrequency(&freq))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (freq.QuadPart <= 9'999'999)
|
||||
if (!freq.QuadPart)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (freq.QuadPart <= 50'000)
|
||||
{
|
||||
// Bad precision
|
||||
return 0;
|
||||
}
|
||||
|
||||
const ullong timer_freq = freq.QuadPart;
|
||||
#else
|
||||
|
||||
|
|
@ -932,7 +938,7 @@ static const bool s_tsc_freq_evaluated = []() -> bool
|
|||
const ullong sec_base = ts0.tv_sec;
|
||||
#endif
|
||||
|
||||
constexpr usz sleep_time_ms = 40;
|
||||
const usz sleep_time_ms = timer_freq <= 300'000 ? (300'000 * 50) / timer_freq : 50;
|
||||
|
||||
for (usz sample = 0; sample < sample_count; sample++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue