VectorSearch/lib_timer/include/timer.h

21 lines
353 B
C
Raw Normal View History

#pragma once
#include <chrono>
2024-03-20 09:59:07 +00:00
#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);