From d4b133e9ac36d87d4b0fdcf105a7f48fee7af162 Mon Sep 17 00:00:00 2001 From: "Adrian.Conlon" Date: Wed, 5 Jul 2017 19:15:58 +0100 Subject: [PATCH] Show cycles per second as MHz Signed-off-by: Adrian.Conlon --- inc/TestHarness.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/TestHarness.h b/inc/TestHarness.h index e5eb166..ec6affc 100644 --- a/inc/TestHarness.h +++ b/inc/TestHarness.h @@ -18,7 +18,7 @@ namespace EightBit { std::cout << "Guest cycles = " << m_totalCycles << std::endl; std::cout << "Seconds = " << getElapsedSeconds() << std::endl; - std::cout << getCyclesPerSecond() << " cycles/second" << std::endl; + std::cout << getCyclesPerSecond() << " MHz" << std::endl; auto elapsedHostCycles = m_finishHostCycles - m_startHostCycles; std::cout << "Host cycles = " << elapsedHostCycles << std::endl; @@ -31,12 +31,12 @@ namespace EightBit { return m_finishTime - m_startTime; } - long long getElapsedSeconds() const { - return std::chrono::duration_cast(getElapsedTime()).count(); + double getElapsedSeconds() const { + return std::chrono::duration_cast>(getElapsedTime()).count(); } - long long getCyclesPerSecond() const { - return m_totalCycles / getElapsedSeconds(); + double getCyclesPerSecond() const { + return (m_totalCycles / 1000000 ) / getElapsedSeconds(); } void runLoop() {