Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for maxDuration (0.17 sec)

  1. staging/src/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go

    */
    
    package request
    
    import (
    	"context"
    	"sync"
    	"time"
    
    	"k8s.io/utils/clock"
    )
    
    func sumDuration(d1 time.Duration, d2 time.Duration) time.Duration {
    	return d1 + d2
    }
    
    func maxDuration(d1 time.Duration, d2 time.Duration) time.Duration {
    	if d1 > d2 {
    		return d1
    	}
    	return d2
    }
    
    // DurationTracker is a simple interface for tracking functions duration,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 13 22:15:37 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  2. src/time/time_test.go

    	want Duration
    }{
    	{0, 0},
    	{1, 1},
    	{-1, 1},
    	{1 * Minute, 1 * Minute},
    	{-1 * Minute, 1 * Minute},
    	{minDuration, maxDuration},
    	{minDuration + 1, maxDuration},
    	{minDuration + 2, maxDuration - 1},
    	{maxDuration, maxDuration},
    	{maxDuration - 1, maxDuration - 1},
    }
    
    func TestDurationAbs(t *testing.T) {
    	for _, tt := range durationAbsTests {
    		if got := tt.d.Abs(); got != tt.want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
  3. src/time/sleep_test.go

    	// but without slowing down fast machines unnecessarily.
    	//
    	// (maxDuration is several orders of magnitude longer than we
    	// expect this test to actually take on a fast, unloaded machine.)
    	d := 1 * Millisecond
    	const maxDuration = 10 * Second
    	for {
    		err := testReset(d)
    		if err == nil {
    			break
    		}
    		d *= 2
    		if d > maxDuration {
    			t.Error(err)
    		}
    		t.Logf("%v; trying duration %v", err, d)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:33:57 UTC 2024
    - 22.5K bytes
    - Viewed (0)
  4. src/time/time.go

    		return d - r
    	}
    	if d1 := d + m - r; d1 > d {
    		return d1
    	}
    	return maxDuration // overflow
    }
    
    // Abs returns the absolute value of d.
    // As a special case, [math.MinInt64] is converted to [math.MaxInt64].
    func (d Duration) Abs() Duration {
    	switch {
    	case d >= 0:
    		return d
    	case d == minDuration:
    		return maxDuration
    	default:
    		return -d
    	}
    }
    
    // Add returns the time t+d.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 50.7K bytes
    - Viewed (0)
Back to top