time package

Go's standard library package for moments, durations, timers and formatting dates, built around the time.Time and time.Duration types.

In more detail

time.Now() returns the current moment as a time.Time; time.Sleep pauses a goroutine for a duration. Keep time and duration distinct: one names a point, the other an interval.

Example

start := time.Now()

Related terms

Taught in

References