Add some time usage statistics and minor cleanup and formatting

This commit is contained in:
2019-03-31 23:35:07 +02:00
parent b29537273b
commit 5d07aba7c4
6 changed files with 52 additions and 32 deletions

View File

@@ -1,12 +1,10 @@
#include <chrono>
#include "timeutils.h"
#include "timeutils.hpp"
Clock::Clock() {
_prev = std::chrono::steady_clock::now();
}
// Calculates the elapsed time since the previous time this function was called.
double getTimeDeltaSeconds() {
static std::chrono::steady_clock::time_point _prev
= std::chrono::steady_clock::now();
double Clock::getTimeDeltaSeconds() {
std::chrono::steady_clock::time_point now
= std::chrono::steady_clock::now();