go-waku/waku/v2/utils/time.go

12 lines
211 B
Go
Raw Normal View History

2021-10-12 13:12:54 +00:00
package utils
import "time"
2021-10-18 13:48:04 +00:00
func GetUnixEpochFrom(now func() time.Time) float64 {
return float64(now().UnixNano()) / float64(time.Second)
}
2021-10-12 13:12:54 +00:00
func GetUnixEpoch() float64 {
2021-10-18 13:48:04 +00:00
return GetUnixEpochFrom(time.Now)
2021-10-12 13:12:54 +00:00
}