lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 26 February 2015 at 17:16, Aapo Talvensaari <aapo.talvensaari@gmail.com> wrote:
>
> could we finally have microseconds or even milliseconds time function in plain Lua?

Sadly accuracy of time varies quite a lot across platforms and environments.

FWIW, luatz has a module to try and get the most accurate time available "luatz.gettime".
You can use the via the more handy aliases `require "luatz".time()` or `require "luatz".now()` for a broken down 'timetable' object.

docs: https://github.com/daurnimator/luatz/blob/master/doc/gettime.md
source: https://github.com/daurnimator/luatz/blob/master/luatz/gettime.lua