go/src/time/sleep_test.go

// newTimerFunc simulates NewTimer using AfterFunc,
// but this version will not hit the special cases for channels
// that are used when calling NewTimer.
// This makes it easy to test both paths.
func newTimerFunc(d Duration) *Timer {}

var haveHighResSleep

// adjustDelay returns an adjusted delay based on the system sleep resolution.
// Go runtime uses different Windows timers for time.Now and sleeping.
// These can tick at different frequencies and can arrive out of sync.
// The effect can be seen, for example, as time.Sleep(100ms) is actually
// shorter then 100ms when measured as difference between time.Now before and
// after time.Sleep call. This was observed on Windows XP SP3 (windows/386).
func adjustDelay(t *testing.T, delay Duration) Duration {}

func TestSleep(t *testing.T) {}

// Test the basic function calling behavior. Correct queuing
// behavior is tested elsewhere, since After and AfterFunc share
// the same code.
func TestAfterFunc(t *testing.T) {}

func TestTickerStress(t *testing.T) {}

func TestTickerConcurrentStress(t *testing.T) {}

func TestAfterFuncStarvation(t *testing.T) {}

func benchmark(b *testing.B, bench func(*testing.PB)) {}

func BenchmarkAfterFunc1000(b *testing.B) {}

func BenchmarkAfter(b *testing.B) {}

func BenchmarkStop(b *testing.B) {}

func BenchmarkSimultaneousAfterFunc1000(b *testing.B) {}

func BenchmarkStartStop1000(b *testing.B) {}

func BenchmarkReset(b *testing.B) {}

func BenchmarkSleep1000(b *testing.B) {}

func TestAfter(t *testing.T) {}

func TestAfterTick(t *testing.T) {}

func TestAfterStop(t *testing.T) {}

func testAfterStop(t *testing.T, newTimer func(Duration) *Timer) {}

func TestAfterQueuing(t *testing.T) {}

func testAfterQueuing(t *testing.T, after func(Duration) <-chan Time) {}

var slots

type afterResult

func await(slot int, result chan<- afterResult, ac <-chan Time) {}

func testAfterQueuing1(delta Duration, after func(Duration) <-chan Time) error {}

func TestTimerStopStress(t *testing.T) {}

func TestSleepZeroDeadlock(t *testing.T) {}

func testReset(d Duration) error {}

func TestReset(t *testing.T) {}

// Test that sleeping (via Sleep or Timer) for an interval so large it
// overflows does not result in a short sleep duration. Nor does it interfere
// with execution of other timers. If it does, timers in this or subsequent
// tests may not fire.
func TestOverflowSleep(t *testing.T) {}

// Test that a panic while deleting a timer does not leave
// the timers mutex held, deadlocking a ticker.Stop in a defer.
func TestIssue5745(t *testing.T) {}

func TestOverflowPeriodRuntimeTimer(t *testing.T) {}

func checkZeroPanicString(t *testing.T) {}

func TestZeroTimerResetPanics(t *testing.T) {}

func TestZeroTimerStopPanics(t *testing.T) {}

// Test that zero duration timers aren't missed by the scheduler. Regression test for issue 44868.
func TestZeroTimer(t *testing.T) {}

func testZeroTimer(t *testing.T, newTimer func(Duration) *Timer) {}

// Test that rapidly moving a timer earlier doesn't cause it to get dropped.
// Issue 47329.
func TestTimerModifiedEarlier(t *testing.T) {}

// Test that rapidly moving timers earlier and later doesn't cause
// some of the sleep times to be lost.
// Issue 47762
func TestAdjustTimers(t *testing.T) {}

func TestStopResult(t *testing.T) {}

func TestResetResult(t *testing.T) {}

// Test that when racing between running a timer and stopping a timer Stop
// consistently indicates whether a value can be read from the channel.
// Issue #69312.
func testStopResetResult(t *testing.T, testStop bool) {}

func testStopResetResultGODEBUG(t *testing.T, testStop bool, godebug string) {}

// Test having a large number of goroutines wake up a ticker simultaneously.
// This used to trigger a crash when run under x/tools/cmd/stress.
func TestMultiWakeupTicker(t *testing.T) {}

// Test having a large number of goroutines wake up a timer simultaneously.
// This used to trigger a crash when run under x/tools/cmd/stress.
func TestMultiWakeupTimer(t *testing.T) {}

// Benchmark timer latency when the thread that creates the timer is busy with
// other work and the timers must be serviced by other threads.
// https://golang.org/issue/38860
func BenchmarkParallelTimerLatency(b *testing.B) {}

// Benchmark timer latency with staggered wakeup times and varying CPU bound
// workloads. https://golang.org/issue/38860
func BenchmarkStaggeredTickerLatency(b *testing.B) {}

// warmupScheduler ensures the scheduler has at least targetThreadCount threads
// in its thread pool.
func warmupScheduler(targetThreadCount int) {}

func doWork(dur Duration) {}

func BenchmarkAdjustTimers10000(b *testing.B) {}