Open tscheer86 opened 4 years ago
It isn't optimal really, but there is mtime()
that returns microseconds ... so the code that uses that tends to look like [time(), mtime()]
.
Is that sufficient?
I believe he was asking due to an anti spam measure I implemented into the $player parser. Currently it limits inputs to 1/second and with this function I should be able to divide that time. Thanks for the reply!
In MOO we've settled on separating this into an ftime()
function that handily returns a float like 1668748884.14323
. In that spirit, I added the method $time.ftime()
with the code:
return tofloat(time() + "." + mtime());
Seems to work. It's also a nice option for not messing with the driver.
For fun, though, I also ported the ftime builtin function that I wrote for ToastStunt. It provides the same time + mtime combination, but it also includes an argument to return monotonic time. The gist of which (ho ho) can be found here if interested: https://gist.github.com/lisdude/b8f7d6ee3fc48788ba83e6b1691d7566
Unable to use time() to monitor less than seconds.