Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 94 for stopTimer (0.2 sec)

  1. src/go/types/self_test.go

    				Selections: make(map[*ast.SelectorExpr]*Selection),
    				Scopes:     make(map[ast.Node]*Scope),
    			}
    		}
    		if _, err := conf.Check(path, fset, files, info); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    	b.ReportMetric(float64(lines)*float64(b.N)/time.Since(start).Seconds(), "lines/s")
    }
    
    func pkgFiles(fset *token.FileSet, path string) ([]*ast.File, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  2. pkg/api/testing/applyconfiguration_test.go

    		builder := &v1mf.PodApplyConfiguration{}
    		if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstr[i%size], builder); err != nil {
    			b.Fatalf("unexpected error: %v", err)
    		}
    	}
    	b.StopTimer()
    }
    
    func BenchmarkApplyConfigurationsToUnstructured(b *testing.B) {
    	items := benchmarkItems(b)
    	convertor := runtime.DefaultUnstructuredConverter
    	builders := make([]*v1mf.PodApplyConfiguration, len(items))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 20:12:50 UTC 2022
    - 7.3K bytes
    - Viewed (0)
  3. src/compress/flate/reader_test.go

    	{"Newton", "../../testdata/Isaac.Newton-Opticks.txt"},
    }
    
    func BenchmarkDecode(b *testing.B) {
    	doBench(b, func(b *testing.B, buf0 []byte, level, n int) {
    		b.ReportAllocs()
    		b.StopTimer()
    		b.SetBytes(int64(n))
    
    		compressed := new(bytes.Buffer)
    		w, err := NewWriter(compressed, level)
    		if err != nil {
    			b.Fatal(err)
    		}
    		for i := 0; i < n; i += len(buf0) {
    			if len(buf0) > n-i {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 09 19:12:23 UTC 2020
    - 2.3K bytes
    - Viewed (0)
  4. src/testing/benchmark.go

    // before a benchmark starts, but it can also be used to resume timing after
    // a call to [B.StopTimer].
    func (b *B) StartTimer() {
    	if !b.timerOn {
    		runtime.ReadMemStats(&memStats)
    		b.startAllocs = memStats.Mallocs
    		b.startBytes = memStats.TotalAlloc
    		b.start = highPrecisionTimeNow()
    		b.timerOn = true
    	}
    }
    
    // StopTimer stops timing a test. This can be used to pause the timer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/pruning/algorithm_test.go

         "unspecified": "bar",
         "unspecifiedObject": {"unspecified": "bar"},
         "pruning": {},
         "preserving": {"unspecified": "bar"}
      }
    }
    `
    
    func BenchmarkPrune(b *testing.B) {
    	b.StopTimer()
    	b.ReportAllocs()
    
    	schema := &structuralschema.Structural{
    		Generic:    structuralschema.Generic{Type: "object"},
    		Extensions: structuralschema.Extensions{XPreserveUnknownFields: true},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  6. pkg/api/testing/unstructured_test.go

    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		unstr, err := convertor.ToUnstructured(&items[i%size])
    		if err != nil || unstr == nil {
    			b.Fatalf("unexpected error: %v", err)
    		}
    	}
    	b.StopTimer()
    }
    
    func BenchmarkFromUnstructured(b *testing.B) {
    	items := benchmarkItems(b)
    	convertor := runtime.DefaultUnstructuredConverter
    	var unstr []map[string]interface{}
    	for i := range items {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/util/rand/rand_test.go

    			}
    		}
    	}
    }
    
    func BenchmarkRandomStringGeneration(b *testing.B) {
    	b.ResetTimer()
    	var s string
    	for i := 0; i < b.N; i++ {
    		s = String(testStringLength)
    	}
    	b.StopTimer()
    	if len(s) == 0 {
    		b.Fatal(s)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Sep 07 13:45:36 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/self_test.go

    				Selections: make(map[*syntax.SelectorExpr]*Selection),
    				Scopes:     make(map[syntax.Node]*Scope),
    			}
    		}
    		if _, err := conf.Check(path, files, info); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    	b.ReportMetric(float64(lines)*float64(b.N)/time.Since(start).Seconds(), "lines/s")
    }
    
    func pkgFiles(path string) ([]*syntax.File, error) {
    	filenames, err := pkgFilenames(path, true) // from stdlib_test.go
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  9. pkg/config/mesh/watcher_test.go

    	if err := os.WriteFile(path, []byte(content), 0o666); err != nil {
    		t.Fatal(err)
    	}
    }
    
    func removeSilent(path string) {
    	_ = os.RemoveAll(path)
    }
    
    func BenchmarkGetMesh(b *testing.B) {
    	b.StopTimer()
    
    	path := newTempFile(b)
    	defer removeSilent(path)
    
    	m := mesh.DefaultMeshConfig()
    	writeMessage(b, path, m)
    
    	w := newWatcher(b, path, false)
    
    	b.StartTimer()
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 3K bytes
    - Viewed (0)
  10. pkg/util/procfs/procfs_linux_test.go

    	}
    
    	re, err := regexp.Compile("(^|/)" + filepath.Base(os.Args[0]) + "$")
    	assert.Empty(b, err)
    
    	for i := 0; i < b.N; i++ {
    		pids := getPids(re)
    
    		b.StopTimer()
    		assert.NotZero(b, pids)
    		assert.Contains(b, pids, os.Getpid())
    		b.StartTimer()
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 20 07:13:28 UTC 2022
    - 3.1K bytes
    - Viewed (0)
Back to top