chrono: replace duration_cast to duration

This commit is contained in:
RadWolfie 2020-08-20 15:51:12 -05:00
parent e0f6d75cd0
commit 8861b845d7
2 changed files with 2 additions and 2 deletions

View File

@ -5217,7 +5217,7 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap)
// Only enter the wait loop if the frame took too long
if (actualDuration < targetDuration) {
// If we need to wait for a larger amount of time (>= 1 frame at 60FPS), we can just sleep
if (std::chrono::duration_cast<std::chrono::milliseconds>(targetTimestamp - std::chrono::steady_clock::now()).count() > 16) {
if ((targetTimestamp - std::chrono::steady_clock::now()) > std::chrono::duration<double, std::milli>(16.0)) {
std::this_thread::sleep_until(targetTimestamp);
} else {
// Otherwise, we fall-through and just keep polling

View File

@ -41,7 +41,7 @@
static uint64_t ptimer_get_clock(NV2AState * d)
{
// Get time in nanoseconds
uint64_t time = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
uint64_t time = std::chrono::duration<uint64_t, std::nano>(std::chrono::steady_clock::now().time_since_epoch()).count();
return Muldiv64(Muldiv64(time,
(uint32_t)d->pramdac.core_clock_freq, // TODO : Research how this can be updated to accept uint64_t