Is there a common way to get the current time in or with milliseconds?
There is os.time(), but it only provides full seconds.
os.time()
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.