Skip to content

Latest commit

 

History

History
executable file
·
26 lines (18 loc) · 489 Bytes

InternalBenchmark.md

File metadata and controls

executable file
·
26 lines (18 loc) · 489 Bytes

type InternalBenchmark

结构:

type InternalBenchmark struct {
    Name string
    F    func(b *B)
}

类型说明:

一个内部类型,只为了跨包使用而成为可导出的;它是“go test”命令实现的一部分。

代码实例:

package main

import (
	"fmt"
	"testing"
)

func main() {
	iBenchmark := testing.InternalBenchmark{Name: "DemoBenchMark", F: func(b *testing.B) {}}
	fmt.Printf("Benchmark: %v\n", iBenchmark)
}