We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90a2dcf commit 64017d1Copy full SHA for 64017d1
src/time/sleep_test.go
@@ -63,7 +63,7 @@ func TestSleep(t *testing.T) {
63
start := Now()
64
Sleep(delay)
65
delayadj := adjustDelay(t, delay)
66
- duration := Now().Sub(start)
+ duration := Since(start)
67
if duration < delayadj {
68
t.Fatalf("Sleep(%s) slept for only %s", delay, duration)
69
}
@@ -322,7 +322,7 @@ func TestAfter(t *testing.T) {
322
323
end := <-After(delay)
324
325
- if duration := Now().Sub(start); duration < delayadj {
+ if duration := Since(start); duration < delayadj {
326
t.Fatalf("After(%s) slept for only %d ns", delay, duration)
327
328
if min := start.Add(delayadj); end.Before(min) {
0 commit comments