1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-04 09:17:17 -05:00
OpenDiablo2/d2common/d2util/timeutils.go

14 lines
302 B
Go
Raw Normal View History

package d2util
import "time"
const (
nanoseconds = 1000000000.0
)
// Now returns how many seconds have elapsed since Unix time (January 1, 1970 UTC)
func Now() float64 {
// Unix time in nanoseconds divided by how many nanoseconds in a second
return float64(time.Now().UnixNano()) / nanoseconds
}