From 7273a2b5fd616f8476ba9d3b3ca74ad44d6fc33c Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Thu, 11 Nov 2021 08:57:28 -0800 Subject: [PATCH] src/testing stub AllocsPerRun --- src/testing/testing.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/testing/testing.go b/src/testing/testing.go index 5b7ec78c..bd829dc8 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -302,6 +302,19 @@ func Verbose() bool { return flagVerbose } +// AllocsPerRun returns the average number of allocations during calls to f. +// Although the return value has type float64, it will always be an integral +// value. +// +// Not implemented. +func AllocsPerRun(runs int, f func()) (avg float64) { + f() + for i := 0; i < runs; i++ { + f() + } + return 0 +} + func TestMain(m *M) { os.Exit(m.Run()) }