summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-10-16 14:41:07 -0400
committersiddharth <s@ricketyspace.net>2021-10-16 14:41:07 -0400
commitce05e028144b790d2b52379237a4eda9407a968c (patch)
tree0ff3fa90b0392fa95e4aa0ed8b829f935ab114cc
parentcc9a9dc2cdcca756b4cb8e926b9627912536c3a8 (diff)
lib: add Sleep
-rw-r--r--lib/time.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/time.go b/lib/time.go
index dbeb843..44bc0d9 100644
--- a/lib/time.go
+++ b/lib/time.go
@@ -9,3 +9,8 @@ import "time"
func SleepRandom(min, max time.Duration) {
time.Sleep(time.Duration(RandomInt(int64(min), int64(max))))
}
+
+// Sleep for `d` nano seconds.
+func Sleep(d time.Duration) {
+ time.Sleep(d)
+}