feat: add naive implementation with timer and word-list generator

This commit is contained in:
Michael Mandl 2024-03-19 17:10:48 +01:00
parent ebf50df679
commit 8ed4b9ac71
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
11 changed files with 243 additions and 3 deletions

17
timer.cpp Normal file
View 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;
}