Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestAfterFunc (0.1 sec)

  1. src/time/sleep_test.go

    		t.Fatalf("Sleep(%s) slept for only %s", delay, duration)
    	}
    }
    
    // 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) {
    	i := 10
    	c := make(chan bool)
    	var f func()
    	f = func() {
    		i--
    		if i >= 0 {
    			AfterFunc(0, f)
    			Sleep(1 * Second)
    		} else {
    			c <- true
    		}
    	}
    
    	AfterFunc(0, f)
    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