times

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 7 Imported by: 0

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 Natural

func Natural(d time.Duration) string

Natural 自然语言显示.

func NaturalNano

func NaturalNano(dur time.Duration) string

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

func Parse added in v1.1.18

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

func ParseNumber added in v1.1.18

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