diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-02-15 18:15:28 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-02-16 03:55:29 +0100 |
commit | 5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2 (patch) | |
tree | f4bd6af64dd1200dd12a4dd9e55f4920b8a8a8cf /src/core/core_timing_util.cpp | |
parent | Merge pull request #2123 from lioncash/coretiming-global (diff) | |
download | yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar.gz yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar.bz2 yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar.lz yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar.xz yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.tar.zst yuzu-5b7ec71fb7cc81ea0f98f019cb0dac0b6bcb2fa2.zip |
Diffstat (limited to 'src/core/core_timing_util.cpp')
-rw-r--r-- | src/core/core_timing_util.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/core_timing_util.cpp b/src/core/core_timing_util.cpp index 88ff70233..8fc92560a 100644 --- a/src/core/core_timing_util.cpp +++ b/src/core/core_timing_util.cpp @@ -60,4 +60,11 @@ s64 nsToCycles(u64 ns) { return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; } +u64 CpuCyclesToClockCycles(u64 ticks) { + u64 result = ticks; + result *= CNTFREQ; + result /= BASE_CLOCK_RATE; + return static_cast<u64>(result); +} + } // namespace Core::Timing |