mbtime

package
v0.0.0-...-c97221a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Since

func Since(u Time) time.Duration

Since returns the time elapsed since t. It is shorthand for time.Now().Sub(t).

Types

type Time

type Time struct {
	// contains filtered or unexported fields
}

Time represents structure for calculating elapsed duration between time interval. It uses different syscalls depending on platform expect for Windows it uses std library time since it already includes boottime.

func New

func New(sec int64, nsec int64) Time

New creates new suspend-aware monotonic time from given initial values. This is mostly useful for unit tests.

func Now

func Now() Time

Now returns current suspend-aware monotonic time.

func (Time) Nano

func (t Time) Nano() time.Duration

Nano returns current duration in nanoseconds.

func (Time) String

func (t Time) String() string

String returns time formatted time string.

func (Time) Sub

func (t Time) Sub(u Time) time.Duration

Sub returns the duration t-u.

Jump to

Keyboard shortcuts

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