summaryrefslogtreecommitdiff
path: root/timeoutat/timeoutat.go
diff options
context:
space:
mode:
Diffstat (limited to 'timeoutat/timeoutat.go')
-rw-r--r--timeoutat/timeoutat.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/timeoutat/timeoutat.go b/timeoutat/timeoutat.go
index 0e13a9f..eac57f2 100644
--- a/timeoutat/timeoutat.go
+++ b/timeoutat/timeoutat.go
@@ -18,17 +18,20 @@ import (
"context"
"fmt"
"time"
+
+ "github.com/network-quality/goresponsiveness/constants"
+ "github.com/network-quality/goresponsiveness/utilities"
)
func TimeoutAt(
ctx context.Context,
when time.Time,
- debug bool,
+ debug constants.DebugLevel,
) (response chan interface{}) {
response = make(chan interface{})
go func(ctx context.Context) {
go func() {
- if debug {
+ if utilities.IsDebug(debug) {
fmt.Printf("Timeout expected to end at %v\n", when)
}
select {
@@ -36,7 +39,7 @@ func TimeoutAt(
case <-ctx.Done():
}
response <- struct{}{}
- if debug {
+ if utilities.IsDebug(debug) {
fmt.Printf("Timeout ended at %v\n", time.Now())
}
}()