mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
src/testing stub AllocsPerRun
This commit is contained in:
@@ -302,6 +302,19 @@ func Verbose() bool {
|
|||||||
return flagVerbose
|
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) {
|
func TestMain(m *M) {
|
||||||
os.Exit(m.Run())
|
os.Exit(m.Run())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user