From fa0e5b89cf742df56c6c8f49fe9b3c54d2970a66 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 27 Apr 2020 09:25:05 -0400 Subject: Add templated GetRandomDuration<> --- src/random.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/random.cpp') diff --git a/src/random.cpp b/src/random.cpp index b408b1e13e..27d8367de4 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -14,16 +14,14 @@ #include #endif #include // for LogPrintf() +#include +#include #include // for Mutex #include // for GetTimeMicros() #include #include -#include - -#include - #ifndef WIN32 #include #include @@ -587,16 +585,6 @@ uint64_t GetRand(uint64_t nMax) noexcept return FastRandomContext(g_mock_deterministic_tests).randrange(nMax); } -std::chrono::microseconds GetRandMicros(std::chrono::microseconds duration_max) noexcept -{ - return std::chrono::microseconds{GetRand(duration_max.count())}; -} - -std::chrono::milliseconds GetRandMillis(std::chrono::milliseconds duration_max) noexcept -{ - return std::chrono::milliseconds{GetRand(duration_max.count())}; -} - int GetRandInt(int nMax) noexcept { return GetRand(nMax); -- cgit v1.2.3