From ce4fd171d1bd6bd2a0c478d78151d4d379f5380b Mon Sep 17 00:00:00 2001 From: siddharth Date: Thu, 1 Jul 2021 00:42:46 -0400 Subject: challenge: do challenge 22 --- lib/time.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/time.go (limited to 'lib/time.go') 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 +// 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)))) +} -- cgit v1.2.3