diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-04-22 18:35:07 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-04-23 14:42:25 -0700 |
commit | 7e93eecce3bc5a1b7bb0284e06f9e2e69454f5ba (patch) | |
tree | 8121fa55daa531931d75252b63075f423b445af8 /src/random.cpp | |
parent | 89eeb4a3335f8e871cc3f5286af4546dff66172a (diff) |
[util] Add method that returns random time in milliseconds
Diffstat (limited to 'src/random.cpp')
-rw-r--r-- | src/random.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/random.cpp b/src/random.cpp index 2a27e6ba0d..f1032feaaf 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -592,6 +592,11 @@ std::chrono::microseconds GetRandMicros(std::chrono::microseconds duration_max) 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); |