Lua - Current time in milliseconds

后端 未结 10 959
自闭症患者
自闭症患者 2020-12-01 01:56

Is there a common way to get the current time in or with milliseconds?

There is os.time(), but it only provides full seconds.

10条回答
  •  萌比男神i
    2020-12-01 02:24

    in openresty there is a function ngx.req.start_time.

    From the docs:

    Returns a floating-point number representing the timestamp (including milliseconds as the decimal part) when the current request was created.

提交回复
热议问题