pause
Package pause implements a method which suspends execution until its given Context is done or it's waited its given timeout.
Usage
package main
import (
"context"
"fmt"
"time"
"github.com/azazeal/pause"
)
func main() {
pause.For(context.TODO(), time.Second)
fmt.Println("about a second elapsed since we called pause.For")
ctx, cancel := context.WithCancel(context.TODO())
cancel()
pause.For(ctx, time.Hour)
fmt.Println("almost no time elapsed since we called pause.For")
}