mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-18 13:41:26 +01:00
[UWP] Fix time query precision (#1284)
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
@ -99,8 +99,8 @@ void App::Run()
|
|||||||
UWPSetQueryTimeFunc([]()
|
UWPSetQueryTimeFunc([]()
|
||||||
{
|
{
|
||||||
static auto timeStart = std::chrono::high_resolution_clock::now();
|
static auto timeStart = std::chrono::high_resolution_clock::now();
|
||||||
auto delta = std::chrono::high_resolution_clock::now() - timeStart;
|
std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - timeStart);
|
||||||
return (double)std::chrono::duration_cast<std::chrono::seconds>(delta).count();
|
return time_span.count();
|
||||||
});
|
});
|
||||||
|
|
||||||
UWPSetSleepFunc([](double seconds) { std::this_thread::sleep_for(std::chrono::duration<double>(seconds)); });
|
UWPSetSleepFunc([](double seconds) { std::this_thread::sleep_for(std::chrono::duration<double>(seconds)); });
|
||||||
|
|||||||
Reference in New Issue
Block a user