示例#1
0
func deepStack(depth int, b *testing.B) stack.Trace {
	if depth > 0 {
		return deepStack(depth-1, b)
	}
	b.StartTimer()
	s := stack.Callers()
	b.StopTimer()
	return s
}
示例#2
0
func BenchmarkCallers(b *testing.B) {
	for i := 0; i < b.N; i++ {
		stack.Callers()
	}
}