Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for TestSleep (0.55 sec)

  1. src/cmd/go/testdata/script/cpu_profile_twice.txt

    go test -o=$WORK/x.test -cpuprofile=$WORK/cpu_profile_twice.out x
    exists $WORK/cpu_profile_twice.out
    
    
    -- x/x_test.go --
    package x_test
    import (
        "testing"
        "time"
    )
    func TestSleep(t *testing.T) {
        time.Sleep(10 * time.Millisecond)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 19 19:57:03 UTC 2019
    - 391 bytes
    - Viewed (0)
  2. src/cmd/go/testdata/script/test_write_profiles_on_timeout.txt

    stdout '^panic: test timed out'
    grep . cpu.pprof
    grep . mem.pprof
    
    -- go.mod --
    module profiling
    
    go 1.16
    -- timeout_test.go --
    package timeouttest_test
    
    import (
    	"testing"
    	"time"
    )
    
    func TestSleep(t *testing.T) {
    	for {
    		time.Sleep(1 * time.Second)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 04 17:47:28 UTC 2021
    - 360 bytes
    - Viewed (0)
  3. src/time/sys_unix.go

    func interrupt() {
    	// There is no mechanism in wasi to interrupt the call to poll_oneoff
    	// used to implement runtime.usleep so this function does nothing, which
    	// somewhat defeats the purpose of TestSleep but we are still better off
    	// validating that time elapses when the process calls time.Sleep than
    	// skipping the test altogether.
    	if runtime.GOOS != "wasip1" {
    		syscall.Kill(syscall.Getpid(), syscall.SIGCHLD)
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:10 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. src/time/sleep_test.go

    	switch runtime.GOOS {
    	case "windows":
    		return delay - 17*Millisecond
    	default:
    		t.Fatal("adjustDelay unimplemented on " + runtime.GOOS)
    		return 0
    	}
    }
    
    func TestSleep(t *testing.T) {
    	const delay = 100 * Millisecond
    	go func() {
    		Sleep(delay / 2)
    		Interrupt()
    	}()
    	start := Now()
    	Sleep(delay)
    	delayadj := adjustDelay(t, delay)
    	duration := Since(start)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:33:57 UTC 2024
    - 22.5K bytes
    - Viewed (0)
Back to top