summaryrefslogtreecommitdiffstats
path: root/src/core/core_timing.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-07-16 01:14:21 +0200
committerLioncash <mathew1800@gmail.com>2020-07-16 01:41:22 +0200
commitbef1844a51a37c1c8dc531e67069ef00821ffa9c (patch)
tree2e46f404c3f0baf1b854e1bea916c19469fe424a /src/core/core_timing.cpp
parentcore_timing: Make use of std::chrono with ScheduleEvent (diff)
downloadyuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.gz
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.bz2
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.lz
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.xz
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.tar.zst
yuzu-bef1844a51a37c1c8dc531e67069ef00821ffa9c.zip
Diffstat (limited to '')
-rw-r--r--src/core/core_timing.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index a5d084e08..b5feb3f24 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -58,7 +58,7 @@ void CoreTiming::Initialize(std::function<void()>&& on_thread_init_) {
event_fifo_id = 0;
shutting_down = false;
ticks = 0;
- const auto empty_timed_callback = [](u64, s64) {};
+ const auto empty_timed_callback = [](u64, std::chrono::nanoseconds) {};
ev_lost = CreateEvent("_lost_event", empty_timed_callback);
if (is_multicore) {
timer_thread = std::make_unique<std::thread>(ThreadEntry, std::ref(*this));
@@ -195,8 +195,9 @@ std::optional<s64> CoreTiming::Advance() {
event_queue.pop_back();
basic_lock.unlock();
- if (auto event_type{evt.type.lock()}) {
- event_type->callback(evt.userdata, global_timer - evt.time);
+ if (const auto event_type{evt.type.lock()}) {
+ event_type->callback(
+ evt.userdata, std::chrono::nanoseconds{static_cast<s64>(global_timer - evt.time)});
}
basic_lock.lock();