1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-27 01:25:35 +00:00
OpenDiablo2/d2common/timeutils.go
lord 6db299b31d
remove most lint errors in d2common (#606)
* removed magic numbers from stream reader/writer and bitstream

* formatting, removing a couple more magic numbers
2020-07-18 18:07:38 -04:00

14 lines
304 B
Go

package d2common
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
}