We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44bb381 commit 7273a2bCopy full SHA for 7273a2b
src/testing/testing.go
@@ -302,6 +302,19 @@ func Verbose() bool {
302
return flagVerbose
303
}
304
305
+// AllocsPerRun returns the average number of allocations during calls to f.
306
+// Although the return value has type float64, it will always be an integral
307
+// value.
308
+//
309
+// Not implemented.
310
+func AllocsPerRun(runs int, f func()) (avg float64) {
311
+ f()
312
+ for i := 0; i < runs; i++ {
313
314
+ }
315
+ return 0
316
+}
317
+
318
func TestMain(m *M) {
319
os.Exit(m.Run())
320
0 commit comments