diff options
| author | Jeff Carr <[email protected]> | 2024-11-07 01:23:43 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-07 01:23:43 -0600 |
| commit | ef61eb494b42a7bc226de1edc114579ce530abdd (patch) | |
| tree | 0bd23b52a8aae23806d8cdc9896936c39cd07728 /sleep.go | |
| parent | 2b11a4e334f465aef868d6c1bf3f1a7c9dfd5c27 (diff) | |
try allowing switching to writing to httpv0.22.2
Diffstat (limited to 'sleep.go')
| -rw-r--r-- | sleep.go | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -6,19 +6,19 @@ package log // a shortcut for sleep so you don't have to always change the import lines when debugging -import ( - "os" - "time" +import ( "errors" + "os" "reflect" + "time" ) /* - sleep() # you know what this does? sleeps for 1 second. yep. dump. easy. - sleep(.1) # you know what this does? yes, it sleeps for 1/10th of a second +sleep() # you know what this does? sleeps for 1 second. yep. dump. easy. +sleep(.1) # you know what this does? yes, it sleeps for 1/10th of a second */ func Sleep(a ...any) { - if (a == nil) { + if a == nil { time.Sleep(time.Second) return } @@ -29,16 +29,16 @@ func Sleep(a ...any) { case int: time.Sleep(time.Duration(a[0].(int)) * time.Second) case float64: - time.Sleep(time.Duration(a[0].(float64) * 1000) * time.Millisecond) + time.Sleep(time.Duration(a[0].(float64)*1000) * time.Millisecond) default: Info("sleep a[0], type = ", a[0], reflect.TypeOf(a[0])) } } /* - exit() # yep. exits. I guess everything must be fine - exit(3) # I guess 3 it is then - exit("dont like apples") # ok. I'll make a note of that +exit() # yep. exits. I guess everything must be fine +exit(3) # I guess 3 it is then +exit("dont like apples") # ok. I'll make a note of that */ func Exit(a ...any) { Error(errors.New("log.Exit()"), a...) |
