diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-05-14 20:10:49 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-18 22:29:28 +0200 |
commit | 45d29436b32bbee1bdf1344e3dc3db365dc42937 (patch) | |
tree | 22c1c2ab550fc0147e8bd9c5525c9ec0d324065f /src | |
parent | Common/Fiber: Address Feedback and Correct Memory leaks. (diff) | |
download | yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar.gz yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar.bz2 yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar.lz yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar.xz yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.tar.zst yuzu-45d29436b32bbee1bdf1344e3dc3db365dc42937.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/core/host_timing.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/tests/core/host_timing.cpp b/src/tests/core/host_timing.cpp index ed060be55..556254098 100644 --- a/src/tests/core/host_timing.cpp +++ b/src/tests/core/host_timing.cpp @@ -22,7 +22,6 @@ static std::array<s64, 5> delays{}; static std::bitset<CB_IDS.size()> callbacks_ran_flags; static u64 expected_callback = 0; -static s64 lateness = 0; template <unsigned int IDX> void HostCallbackTemplate(u64 userdata, s64 nanoseconds_late) { @@ -34,8 +33,6 @@ void HostCallbackTemplate(u64 userdata, s64 nanoseconds_late) { ++expected_callback; } -static u64 callbacks_done = 0; - struct ScopeInit final { ScopeInit() { core_timing.Initialize(); @@ -47,6 +44,20 @@ struct ScopeInit final { Core::HostTiming::CoreTiming core_timing; }; +#pragma optimize("", off) + +static u64 TestTimerSpeed(Core::HostTiming::CoreTiming& core_timing) { + u64 start = core_timing.GetGlobalTimeNs().count(); + u64 placebo = 0; + for (std::size_t i = 0; i < 1000; i++) { + placebo += core_timing.GetGlobalTimeNs().count(); + } + u64 end = core_timing.GetGlobalTimeNs().count(); + return (end - start); +} + +#pragma optimize("", on) + TEST_CASE("HostTiming[BasicOrder]", "[core]") { ScopeInit guard; auto& core_timing = guard.core_timing; @@ -85,18 +96,6 @@ TEST_CASE("HostTiming[BasicOrder]", "[core]") { } } -#pragma optimize("", off) -u64 TestTimerSpeed(Core::HostTiming::CoreTiming& core_timing) { - u64 start = core_timing.GetGlobalTimeNs().count(); - u64 placebo = 0; - for (std::size_t i = 0; i < 1000; i++) { - placebo += core_timing.GetGlobalTimeNs().count(); - } - u64 end = core_timing.GetGlobalTimeNs().count(); - return (end - start); -} -#pragma optimize("", on) - TEST_CASE("HostTiming[BasicOrderNoPausing]", "[core]") { ScopeInit guard; auto& core_timing = guard.core_timing; |