mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-03-06 06:30:14 +00:00
Show cycles per second as MHz
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
7910ada7fa
commit
d4b133e9ac
@ -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<std::chrono::seconds>(getElapsedTime()).count();
|
||||
double getElapsedSeconds() const {
|
||||
return std::chrono::duration_cast<std::chrono::duration<double>>(getElapsedTime()).count();
|
||||
}
|
||||
|
||||
long long getCyclesPerSecond() const {
|
||||
return m_totalCycles / getElapsedSeconds();
|
||||
double getCyclesPerSecond() const {
|
||||
return (m_totalCycles / 1000000 ) / getElapsedSeconds();
|
||||
}
|
||||
|
||||
void runLoop() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user