Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 263 for resetTime (0.15 sec)

  1. internal/grid/types_test.go

    	v := MSS{"abc": "def", "ghi": "jkl"}
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		v.MarshalMsg(nil)
    	}
    }
    
    func BenchmarkAppendMsgMSS(b *testing.B) {
    	v := MSS{"abc": "def", "ghi": "jkl"}
    	bts := make([]byte, 0, v.Msgsize())
    	bts, _ = v.MarshalMsg(bts[0:0])
    	b.SetBytes(int64(len(bts)))
    	b.ReportAllocs()
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		bts, _ = v.MarshalMsg(bts[0:0])
    	}
    }
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Nov 21 01:09:35 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. src/encoding/gob/timing_test.go

    	enc := NewEncoder(&buf)
    	err := enc.Encode(a)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	ra := reflect.ValueOf(a)
    	rt := ra.Type()
    	b.ResetTimer()
    
    	b.ReportAllocs()
    	b.RunParallel(func(pb *testing.PB) {
    		// TODO(#19025): Move per-thread allocation before ResetTimer.
    		rp := reflect.New(rt)
    		rp.Elem().Set(reflect.MakeSlice(rt, ra.Len(), ra.Cap()))
    		p := rp.Interface()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 04 07:16:59 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  3. src/os/exec/bench_test.go

    package exec
    
    import (
    	"testing"
    )
    
    func BenchmarkExecHostname(b *testing.B) {
    	b.ReportAllocs()
    	path, err := LookPath("hostname")
    	if err != nil {
    		b.Fatalf("could not find hostname: %v", err)
    	}
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		if err := Command(path).Run(); err != nil {
    			b.Fatalf("hostname: %v", err)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Mar 03 18:43:53 UTC 2019
    - 492 bytes
    - Viewed (0)
  4. src/cmd/compile/internal/reflectdata/alg_test.go

    		a string
    		b int
    	}
    	const size = 1024
    	var (
    		str1 = "foobar"
    
    		a [size]T2
    		c [size]T2
    	)
    
    	for i := 0; i < size; i++ {
    		a[i].a = str1
    		c[i].a = str1
    	}
    
    	b.ResetTimer()
    	for j := 0; j < b.N; j++ {
    		_ = a == c
    	}
    }
    
    func BenchmarkEqArrayOfStructsNotEq(b *testing.B) {
    	type T2 struct {
    		a string
    		b int
    	}
    	const size = 1024
    	var (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  5. src/go/token/position_bench_test.go

    	data := make([]int, 10000)
    	for i := 0; i < 10000; i++ {
    		data[i] = i
    	}
    	const x = 8
    	if r := searchInts(data, x); r != x {
    		b.Errorf("got index = %d; want %d", r, x)
    	}
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		searchInts(data, x)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 23 01:37:31 UTC 2021
    - 484 bytes
    - Viewed (0)
  6. src/crypto/tls/cache_test.go

    	}
    
    	cc := certCache{}
    	b.ReportAllocs()
    	b.ResetTimer()
    	// We expect that calling newCert additional times after
    	// the initial call should not cause additional allocations.
    	for extra := 0; extra < 4; extra++ {
    		b.Run(fmt.Sprint(extra), func(b *testing.B) {
    			actives := make([]*activeCert, extra+1)
    			b.ResetTimer()
    			for i := 0; i < b.N; i++ {
    				var err error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 07 19:46:27 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  7. src/cmd/go/internal/cfg/bench_test.go

    // license that can be found in the LICENSE file.
    
    package cfg
    
    import (
    	"internal/testenv"
    	"testing"
    )
    
    func BenchmarkLookPath(b *testing.B) {
    	testenv.MustHaveExecPath(b, "go")
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		_, err := LookPath("go")
    		if err != nil {
    			b.Fatal(err)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 11 20:12:18 UTC 2023
    - 404 bytes
    - Viewed (0)
  8. cmd/xl-storage-format_test.go

    			}
    			b.Logf("Serialized size: %d bytes", len(enc))
    			rng := rand.New(rand.NewSource(0))
    			dump := make([]byte, len(enc))
    			b.Run("UpdateObjectVersion", func(b *testing.B) {
    				b.SetBytes(int64(size))
    				b.ResetTimer()
    				b.ReportAllocs()
    				for i := 0; i < b.N; i++ {
    					// Load...
    					xl = xlMetaV2{}
    					err := xl.Load(enc)
    					if err != nil {
    						b.Fatal(err)
    					}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Feb 22 06:26:06 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  9. src/go/doc/testdata/benchmark.go

    // want to measure.
    func (b *B) StopTimer() {
    	if b.timerOn {
    		b.duration += time.Since(b.start)
    		b.timerOn = false
    	}
    }
    
    // ResetTimer sets the elapsed benchmark time to zero.
    // It does not affect whether the timer is running.
    func (b *B) ResetTimer() {
    	if b.timerOn {
    		b.start = time.Now()
    	}
    	b.duration = 0
    }
    
    // SetBytes records the number of bytes processed in a single operation.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  10. pkg/config/analysis/analyzers/analyzers_bench_test.go

    		b.Run(tc.name+"-bench", func(b *testing.B) {
    			sa, err := setupAnalyzerForCase(tc, nil)
    			if err != nil {
    				b.Fatalf("Error setting up analysis for benchmark on testcase %s: %v", tc.name, err)
    			}
    
    			b.ResetTimer()
    
    			// Run the analysis
    			_, err = runAnalyzer(sa)
    			if err != nil {
    				b.Fatalf("Error running analysis for benchmark on testcase %s: %v", tc.name, err)
    			}
    		})
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 02 08:32:06 UTC 2024
    - 3.3K bytes
    - Viewed (0)
Back to top