benchmark

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: GPL-3.0 Imports: 5 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 SpentTime added in v1.7.3

func SpentTime(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