benchmark

package
v1.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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())

并行执行测试并打印结果

func Spent added in v1.8.2

func Spent(msg string, f func()) time.Duration

打印执行函数消耗的时间

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

并行执行测试

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL