mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 05:34:38 -04:00
Merge branch 'main' of https://github.com/TakaRikka/dusk
This commit is contained in:
@@ -369,11 +369,11 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast<std::chrono::nanosecond
|
||||
std::chrono::duration<double>(1001.0 / 30000.0));
|
||||
constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2;
|
||||
|
||||
static void waitPrecise(Limiter& limiter, Uint64 targetNs) {
|
||||
const auto sleepTime = limiter.SleepTime(std::chrono::nanoseconds(targetNs));
|
||||
static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) {
|
||||
const auto sleepTime = limiter.SleepTime(targetNs);
|
||||
dusk::frameUsagePct =
|
||||
100.0f * (1.0f - static_cast<float>(sleepTime.count()) / static_cast<float>(targetNs));
|
||||
limiter.Sleep(std::chrono::nanoseconds(targetNs));
|
||||
100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs));
|
||||
limiter.Sleep(targetNs);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user