summaryrefslogtreecommitdiffstats
path: root/lib/time.go
blob: 0efc92ec93da89f42294e957a992ea0d1312f880 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright © 2021 siddharth ravikumar <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))))
}

// Sleep for `d` nano seconds.
func Sleep(d time.Duration) {
	time.Sleep(d)
}