gre.mstime

gre.mstime()
gre.mstime(app_relative)
                    

Retrieve the current time in milliseconds in the default, no argument flavour. This call provides a higher resolution than the standard Lua os.clock()or os.date() functions.

When true is passed in as an argument, then the time returned will be relative to the application start time and aligned with the timestamps that are generated by the Storyboard logging API.

Returns: The current time in milliseconds in a system specific manner (gre.mstime()) or the time in milliseconds since the start of the application (gre.mstime(true)) Example:

-- Time an operation
local s = gre.mstime()
my_function()
local e = gre.mstime()
print("my_function took " .. tostring(e - s) .. "ms")

-- Determine how long from app start to this point
local delta = gre.mstime(true)
print(string.format("Application start to now: %d ms", delta)
                    
Was this article helpful?
0 out of 0 found this helpful