minetest.get_us_time

From Minetest Developer Wiki
Revision as of 21:08, 9 May 2015 by Prestidigitator (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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;