Help us shape the future of Go! Take the 2026 Go Developer Survey

timeutil

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats a duration for display like the debug npm package. It provides granular formatting from nanoseconds to hours.

func FormatDurationMs added in v0.65.6

func FormatDurationMs(ms int) string

FormatDurationMs formats a duration given in milliseconds as a human-readable string. Examples: 500 -> "500ms", 1500 -> "1.5s", 90000 -> "1m30s"

func FormatDurationNs added in v0.65.6

func FormatDurationNs(ns int64) string

FormatDurationNs formats a duration given in nanoseconds as a human-readable string. Returns "—" for zero or negative values. Uses Go's standard duration rounding to seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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