refactor: extract lib_timer
This commit is contained in:
parent
14dbf00775
commit
10b19749f7
8 changed files with 433 additions and 4 deletions
20
lib_timer/include/timer.h
Normal file
20
lib_timer/include/timer.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <ostream>
|
||||
|
||||
class Timer {
|
||||
private:
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> start_;
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> end_;
|
||||
|
||||
public:
|
||||
Timer();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
long us() const;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Timer &timer);
|
Loading…
Add table
Add a link
Reference in a new issue