Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestReportMetric (0.11 sec)

  1. src/testing/benchmark_test.go

    			var buf bytes.Buffer
    			for pb.Next() {
    				// The loop body is executed b.N times total across all goroutines.
    				buf.Reset()
    				templ.Execute(&buf, "World")
    			}
    		})
    	})
    }
    
    func TestReportMetric(t *testing.T) {
    	res := testing.Benchmark(func(b *testing.B) {
    		b.ReportMetric(12345, "ns/op")
    		b.ReportMetric(0.2, "frobs/op")
    	})
    	// Test built-in overriding.
    	if res.NsPerOp() != 12345 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.6K bytes
    - Viewed (0)
Back to top