Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 142 for microsecond (0.26 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_proto.go

    func (m *MicroTime) ProtoMicroTime() *Timestamp {
    	if m == nil {
    		return &Timestamp{}
    	}
    
    	// truncate precision to microseconds to match JSON marshaling/unmarshaling
    	truncatedNanoseconds := time.Duration(m.Time.Nanosecond()).Truncate(time.Microsecond)
    	return &Timestamp{
    		Seconds: m.Time.Unix(),
    		Nanos:   int32(truncatedNanoseconds),
    	}
    }
    
    // Size implements the protobuf marshalling interface.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 02 08:21:04 UTC 2022
    - 2.3K bytes
    - Viewed (0)
  2. pkg/queue/instance_test.go

    	"time"
    
    	"go.uber.org/atomic"
    
    	"istio.io/istio/pkg/test/util/assert"
    	"istio.io/istio/pkg/test/util/retry"
    )
    
    func TestOrdering(t *testing.T) {
    	numValues := 1000
    
    	q := NewQueue(1 * time.Microsecond)
    	stop := make(chan struct{})
    	defer close(stop)
    
    	wg := sync.WaitGroup{}
    	wg.Add(numValues)
    	mu := sync.Mutex{}
    	out := make([]int, 0)
    	for i := 0; i < numValues; i++ {
    		i := i
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jul 21 16:30:36 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  3. tests/test_datetime_custom_encoder.py

        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
            def serialize_datetime(self, dt_field: datetime):
                return dt_field.replace(microsecond=0, tzinfo=timezone.utc).isoformat()
    
        app = FastAPI()
        model = ModelWithDatetimeField(dt_field=datetime(2019, 1, 1, 8))
    
        @app.get("/model", response_model=ModelWithDatetimeField)
        def get_model():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  4. src/cmd/go/internal/trace/trace.go

    		ID:       id,
    		Time:     float64(from.end.UnixNano()) / float64(time.Microsecond),
    		Phase:    phaseFlowStart,
    		TID:      from.tid,
    	})
    	tc.t.writeEvent(&format.Event{
    		Name:      from.name + " -> " + to.name,
    		Category:  "flow", // TODO(matloob): Add Category to Flow?
    		ID:        id,
    		Time:      float64(to.start.UnixNano()) / float64(time.Microsecond),
    		Phase:     phaseFlowEnd,
    		TID:       to.tid,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 20:45:06 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  5. pkg/test/echo/common/util.go

    }
    
    // MicrosToDuration converts the given microseconds to a time.Duration.
    func MicrosToDuration(micros int64) time.Duration {
    	return time.Duration(micros) * time.Microsecond
    }
    
    // DurationToMicros converts the given duration to microseconds.
    func DurationToMicros(d time.Duration) int64 {
    	return int64(d / time.Microsecond)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 01 01:05:45 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  6. pkg/queue/metrics_test.go

    import (
    	"sync"
    	"testing"
    	"time"
    
    	"istio.io/istio/pilot/pkg/features"
    )
    
    func BenchmarkMetricsQueue(b *testing.B) {
    	features.EnableControllerQueueMetrics = true
    	q := NewQueue(1 * time.Microsecond)
    	s := make(chan struct{})
    	go q.Run(s)
    	for n := 0; n < b.N; n++ {
    		wg := sync.WaitGroup{}
    		wg.Add(1)
    		q.Push(func() error {
    			wg.Done()
    			return nil
    		})
    		wg.Wait()
    
    	}
    	close(s)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jul 21 16:30:36 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  7. src/runtime/race/testdata/mutex_test.go

    	ch := make(chan bool, 2)
    	go func() {
    		x = 1
    		mu.Lock()
    		written = true
    		mu.Unlock()
    		ch <- true
    	}()
    	go func() {
    		time.Sleep(100 * time.Microsecond)
    		mu.Lock()
    		for !written {
    			mu.Unlock()
    			time.Sleep(100 * time.Microsecond)
    			mu.Lock()
    		}
    		mu.Unlock()
    		x = 1
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestNoRaceMutexSemaphore(t *testing.T) {
    	var mu sync.Mutex
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 23 22:14:38 UTC 2021
    - 2K bytes
    - Viewed (0)
  8. pkg/apis/core/validation/events.go

    	allErrs = append(allErrs, ValidateImmutableField(newEvent.Type, oldEvent.Type, field.NewPath("type"))...)
    
    	// Disallow changes to eventTime greater than microsecond-level precision.
    	// Tolerating sub-microsecond changes is required to tolerate updates
    	// from clients that correctly truncate to microsecond-precision when serializing,
    	// or from clients built with incorrect nanosecond-precision protobuf serialization.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Sep 01 19:47:37 UTC 2022
    - 9.2K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/storage/etcd3/preflight/checks_test.go

    	}
    	if result {
    		t.Fatal("CheckEtcdServers should not have succeeded")
    	}
    }
    
    func TestPollCheckServer(t *testing.T) {
    	err := utilwait.PollImmediate(1*time.Microsecond,
    		2*time.Microsecond,
    		EtcdConnection{ServerList: []string{""}}.CheckEtcdServers)
    	if err == nil {
    		t.Fatal("expected check to time out")
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 01 21:37:52 UTC 2017
    - 2.7K bytes
    - Viewed (0)
  10. pkg/backoff/exponential_test.go

    	start time.Time
    }
    
    func (c *TestClock) Now() time.Time {
    	t := c.start.Add(c.i)
    	c.i += time.Second
    	return t
    }
    
    func TestRetry(t *testing.T) {
    	o := DefaultOption()
    	o.InitialInterval = 1 * time.Microsecond
    	ebf := NewExponentialBackOff(o)
    
    	// Run a task that fails the first time and retries.
    	wg := sync.WaitGroup{}
    	wg.Add(2)
    	failed := false
    	err := ebf.RetryWithContext(context.TODO(), func() error {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 05 16:03:30 UTC 2022
    - 2.6K bytes
    - Viewed (0)
Back to top