refactor: return numerical value from timer
This commit is contained in:
parent
f7634bdd95
commit
64ae4c62a9
3 changed files with 17 additions and 16 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue