refactor: return numerical value from timer

This commit is contained in:
Michael Mandl 2024-03-20 09:58:40 +01:00
parent f7634bdd95
commit 64ae4c62a9
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
3 changed files with 17 additions and 16 deletions

View file

@ -1,16 +1,17 @@
#pragma once
#include <chrono>
#include <string>
class Timer {
private:
std::string name_;
std::chrono::time_point<std::chrono::high_resolution_clock> start_;
std::chrono::time_point<std::chrono::high_resolution_clock> end_;
public:
Timer(std::string_view name);
Timer();
void start();
void stop();
long us() const;
};