mirror of
https://github.com/kopia/kopia.git
synced 2026-04-27 09:27:54 -04:00
17 lines
341 B
Go
17 lines
341 B
Go
// Package clock provides indirection for accessing current time.
|
|
package clock
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Since returns time since the given timestamp.
|
|
func Since(t time.Time) time.Duration {
|
|
return Now().Sub(t)
|
|
}
|
|
|
|
// Until returns duration of time between now and a given time.
|
|
func Until(t time.Time) time.Duration {
|
|
return t.Sub(Now())
|
|
}
|