mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 730da698a3 |
@@ -159,6 +159,7 @@ func (b *B) ReportAllocs() {
|
|||||||
|
|
||||||
// runN runs a single benchmark for the specified number of iterations.
|
// runN runs a single benchmark for the specified number of iterations.
|
||||||
func (b *B) runN(n int) {
|
func (b *B) runN(n int) {
|
||||||
|
b.runCleanup() // start fresh in the next iteration
|
||||||
b.N = n
|
b.N = n
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
@@ -457,6 +458,7 @@ func (b *B) Run(name string, f func(b *B)) bool {
|
|||||||
// Only process sub-benchmarks, if any.
|
// Only process sub-benchmarks, if any.
|
||||||
sub.hasSub = true
|
sub.hasSub = true
|
||||||
}
|
}
|
||||||
|
defer sub.runCleanup() // make sure all cleanups are run, even when panicking
|
||||||
if sub.run1() {
|
if sub.run1() {
|
||||||
sub.run()
|
sub.run()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user