refactor: move searching to static library
This commit is contained in:
parent
8ed4b9ac71
commit
32a1cd7533
11 changed files with 20 additions and 2 deletions
17
lib_vector_search/src/timer.cpp
Normal file
17
lib_vector_search/src/timer.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "timer.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
Timer::Timer(std::string_view name) : name_(name) { start(); };
|
||||
|
||||
void Timer::start() { start_ = std::chrono::high_resolution_clock::now(); }
|
||||
|
||||
void Timer::stop() {
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
|
||||
auto duration =
|
||||
std::chrono::duration_cast<std::chrono::microseconds>(end - start_);
|
||||
|
||||
std::cout << name_ << " took " << duration << std::endl;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue