Difference between revisions of "minetest.get us time"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:minetest.get_us_time}} == Syntax == <source>minetest.get_us_time()</source> == Description == returns time with microsecond precision. This does not seem to b...") |
(No difference)
|
Revision as of 21:08, 9 May 2015
Syntax
minetest.get_us_time()
Description
returns time with microsecond precision. This does not seem to be strictly related to game time or time of day in a meaningful way, but should be useful for taking differences in time measured during a single execution of the server. For example, it can be useful for profiling mod performance.
Example
local t0_us = minetest.get_us_time();
-- ...
local t1_us = minetest.get_us_time();
local elapsed_time_in_seconds = (t1_us - t0_us)/1000000.0;