MCPcopy Index your code
hub / github.com/desertbit/timer / TestSingleTimout

Function TestSingleTimout

timer_test.go:47–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestSingleTimout(t *testing.T) {
48 // Timeout for 1 second and wait.
49 start := time.Now()
50 timer := NewTimer(time.Second)
51 <-timer.C
52 if int(time.Since(start).Seconds()) != 1 {
53 t.Errorf("took ~%v seconds, should be ~1 seconds\n", int(time.Since(start).Seconds()))
54 }
55}
56
57func TestMultipleTimouts(t *testing.T) {
58 start := time.Now()

Callers

nothing calls this directly

Calls 1

NewTimerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…