Documentation ¶ Index ¶ func DoAndPrint(count int, title string, loop func()) func DoParallelAndPrint(concurrent int, count int, title string, loop func()) type Result func Do(count int, loop func()) Result func DoParallel(concurrent int, count int, loop func()) Result Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func DoAndPrint ¶ func DoAndPrint(count int, title string, loop func()) 执行测试并打印结果 func DoParallelAndPrint ¶ func DoParallelAndPrint(concurrent int, count int, title string, loop func()) 并行执行测试并打印结果 Types ¶ type Result ¶ type Result struct { Count int `json:"count"` Spent time.Duration `json:"spent"` TPS int `json:"tps"` } func Do ¶ func Do(count int, loop func()) Result 执行测试 func DoParallel ¶ func DoParallel(concurrent int, count int, loop func()) Result 并行执行测试 Source Files ¶ View all Source files benchmark.go Click to show internal directories. Click to hide internal directories.