summaryrefslogtreecommitdiffstats
path: root/lib/time.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-07-01 00:42:46 -0400
committersiddharth <s@ricketyspace.net>2021-07-01 00:42:46 -0400
commitce4fd171d1bd6bd2a0c478d78151d4d379f5380b (patch)
treec00c3db23cdfffa1a35b3b70faa4fad497c89723 /lib/time.go
parent78cbe992554636a91a655bc2641f023aae75b204 (diff)
challenge: do challenge 22
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))))
+}