costtime

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cost added in v0.2.0

func Cost(run func())

Cost 里面计算消耗时间

func CostLog added in v0.2.0

func CostLog(name string, run func())

CostLog 计算消耗的时间

func SetLogCondition added in v0.2.0

func SetLogCondition(cond ConditionFunc)

SetLogCondition 设置输出cost条件

Types

type ConditionFunc added in v0.3.0

type ConditionFunc func(cost time.Duration) bool

ConditionFunc 日志输出条件判断函数

func CondGT added in v0.3.0

func CondGT(t time.Duration) ConditionFunc

CondGT 创建cost>t时间输出日志的条件

func CondGTE added in v0.3.0

func CondGTE(t time.Duration) ConditionFunc

CondGTE 创建cost>=t时间输出日志的条件

func CondLT added in v0.3.0

func CondLT(t time.Duration) ConditionFunc

CondLT 创建cost<t时间输出日志的条件

func CondLTE added in v0.3.0

func CondLTE(t time.Duration) ConditionFunc

CondLTE 创建cost<=t时间输出日志的条件

func CondRange added in v0.3.0

func CondRange(t1, t2 time.Duration) ConditionFunc

CondRange 创建t1<=cost<=t2时间输出日志的条件

Jump to

Keyboard shortcuts

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