From e5cba7e261db4991f47dca421c14fda4489d2b5d Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 1 Jan 2022 09:23:42 +0100 Subject: [PATCH] accumulator: add wait_for() --- accumulator.cpp | 6 ++++++ accumulator.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/accumulator.cpp b/accumulator.cpp index e4e3409..33787be 100644 --- a/accumulator.cpp +++ b/accumulator.cpp @@ -2,10 +2,16 @@ #define FORTUNA_ACCUMULATOR_CPP #include "accumulator.h" +#include +#include namespace fortuna { namespace accumulator { +auto wait_for(uint milliseconds) -> void { + std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds}); +} + Accumulator::Accumulator() { this->Gen = nullptr; } diff --git a/accumulator.h b/accumulator.h index da1ac1d..a89baf3 100644 --- a/accumulator.h +++ b/accumulator.h @@ -50,6 +50,9 @@ public: fmt::print("{}", e.what()); } } + + auto wait_for(uint milliseconds) -> void; + Accumulator(); ~Accumulator() noexcept;