Discover Packages
gitea.com/gruf/go-nowish
package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Sep 30, 2021
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
a simple Go library with useful time utiities:
Clock: a high performance clock giving a good "ish" representation of "now" (hence the name!)
Timeout: a reusable structure for enforcing timeouts with a cancel
Expand ▾
Collapse ▴
Documentation
¶
Start returns a new Clock instance initialized and
started with the provided precision, along with the
stop function for it's underlying timer
Now returns a good (ish) estimate of the current 'now' time
NowFormat returns the formatted "now" time, cached until next tick and "now" updates
SetFormat sets the time format string used by .NowFormat()
Start starts the clock with the provided precision, the
returned function is the stop function for the underlying timer
Timeout provides a reusable structure for enforcing timeouts with a cancel
NewTimeout returns a new Timeout instance
Cancel cancels the currently running timer. If a cancel is achieved, then
this function will return after the timeout goroutine is finished
Start starts the timer with supplied timeout. If timeout is reached before
cancel then supplied timeout hook will be called. Error may be called if
Timeout is already running when this function is called
Source Files
¶
Click to show internal directories.
Click to hide internal directories.