Type Function Library os.* Return value Number Revision 2017.3060 Keywords difftime, time, date, difference See also os.time() os.clock() os.date()
Returns the number of seconds from time t1
to time t2
. In POSIX, Windows, and some other systems, this value is exactly t2 - t1
.
os.difftime( t1, t2 )
Number. First time parameter (in t2 - t1
).
Number. Second time parameter (in t2 - t1
).
local t1 = os.time() -- Print the elasped time local function dspTime() print( "Time elasped = " .. os.difftime( os.time(), t1) ) end timer.performWithDelay( 2000, dspTime ) -- Wait 2 seconds before calling function