Closed jkleiser closed 5 years ago
Reasonable. Would you kindly send a pull request?
https://github.com/glycerine/zygomys/blob/master/zygo/time.go is probably the best place to add such things.
I will give it a try. Maybe later this week.
It took a while before I got it right, but now I have a function (in my local fork) that returns the milliseconds based on time.Now().UnixNano(). I have two questions:
What do you prefer that I name this function, unixmillis
or just millis
?
In the file cmd/zygo/main.go, line 9, I had to change the import to "github.com/jkleiser/zygomys/zygo"
. Is there a way to write this to avoid it being so github specific?
unixmillis or just millis?
your call, but I like the shorter name
In the file cmd/zygo/main.go, line 9, I had to change the import to "github.com/jkleiser/zygomys/zygo". Is there a way to write this to avoid it being so github specific?
not that I'm aware of. If you file a PR though, leave it pointing at glycerine/zygomys so the project still builds by default with a go get
.
Agreed on "millis".
I see that zygo has time related functions like
now
,astm
andtimeit
, but I cannot find any function returning milliseconds since some fixed time (1970-01-01), or since zygo launch. Floating point seconds with decimals could also do.