times

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Overview

Package time 时间相关工具.

包括 计时器 ClockStart, ClockCount, ClockStop. Natural、NaturalNano 自然语言时间间隔显示.

Index

Constants

This section is empty.

Variables

View Source
var ErrParseError = errors.New("parse error")

Functions

func ClockCount

func ClockCount(clock int64) time.Duration

ClockCount 计次.

func ClockStart

func ClockStart() int64

ClockStart 计时器开始.

func ClockStop

func ClockStop(clock int64) time.Duration

ClockStop 计时器截止.

func Debounced added in v0.4.26

func Debounced(fun func(), interval time.Duration) func()

Debounced 防抖函数.

func Natural

func Natural(d time.Duration) string

Natural 自然语言显示.

func NaturalNano

func NaturalNano(dur time.Duration) string

NaturalNano 自然语言显示精确到纳秒.

func Parse

func Parse(str string) (time.Time, error)

func ParseNumber

func ParseNumber[T constraints.Integer | constraints.Float](num T) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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