From 96b2d8419c94f9bcb5f2f970bbb453aa7383b510 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sat, 15 Feb 2020 13:56:50 -0400 Subject: HostTiming: Correct rebase and implement AddTicks. --- src/core/host_timing.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/host_timing.h') diff --git a/src/core/host_timing.h b/src/core/host_timing.h index cd44b308c..5ad8c5f35 100644 --- a/src/core/host_timing.h +++ b/src/core/host_timing.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -18,6 +19,7 @@ #include "common/thread.h" #include "common/threadsafe_queue.h" #include "common/wall_clock.h" +#include "core/hardware_properties.h" namespace Core::HostTiming { @@ -91,6 +93,11 @@ public: /// We only permit one event of each type in the queue at a time. void RemoveEvent(const std::shared_ptr& event_type); + + void AddTicks(std::size_t core_index, u64 ticks); + + void ResetTicks(std::size_t core_index); + /// Returns current time in emulated CPU cycles u64 GetCPUTicks() const; @@ -138,6 +145,8 @@ private: std::atomic wait_set{}; std::atomic shutting_down{}; std::atomic has_started{}; + + std::array, Core::Hardware::NUM_CPU_CORES> ticks_count{}; }; /// Creates a core timing event with the given name and callback. -- cgit v1.2.3