mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
22 lines
389 B
Go
22 lines
389 B
Go
// Package time is a wrapper around the go standard time library.
|
|
package time
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Since returns the duration since t.
|
|
func Since(t time.Time) time.Duration {
|
|
return Now().Sub(t)
|
|
}
|
|
|
|
// Until returns the duration until t.
|
|
func Until(t time.Time) time.Duration {
|
|
return t.Sub(Now())
|
|
}
|
|
|
|
// Now returns the current local time.
|
|
func Now() time.Time {
|
|
return time.Now()
|
|
}
|