21 lines
353 B
C
21 lines
353 B
C
|
#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);
|