summaryrefslogtreecommitdiffstats
path: root/lib/time.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/time.go')
-rw-r--r--lib/time.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/time.go b/lib/time.go
new file mode 100644
index 0000000..dbeb843
--- /dev/null
+++ b/lib/time.go
@@ -0,0 +1,11 @@
+// Copyright © 2021 rsiddharth <s@ricketyspace.net>
+// SPDX-License-Identifier: ISC
+
+package lib
+
+import "time"
+
+// Sleeps for atleast `min` but not more than `max`.
+func SleepRandom(min, max time.Duration) {
+ time.Sleep(time.Duration(RandomInt(int64(min), int64(max))))
+}