diff options
| author | Amiti Uttarwar <[email protected]> | 2020-04-22 18:35:07 -0700 |
|---|---|---|
| committer | Amiti Uttarwar <[email protected]> | 2020-04-23 14:42:25 -0700 |
| commit | 7e93eecce3bc5a1b7bb0284e06f9e2e69454f5ba (patch) | |
| tree | 8121fa55daa531931d75252b63075f423b445af8 /src/random.cpp | |
| parent | [mempool] Track "unbroadcast" transactions (diff) | |
| download | discoin-7e93eecce3bc5a1b7bb0284e06f9e2e69454f5ba.tar.xz discoin-7e93eecce3bc5a1b7bb0284e06f9e2e69454f5ba.zip | |
[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 2a27e6ba0..f1032feaa 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); |