类型 函数 库 os.* 返回值 数字 修订 2024.3703 版 关键字 difftime,时间,日期,差异 另请参阅 os.time() os.clock() os.date()
从时间 t1
返回到时间 t2
的秒数。在 POSIX、Windows 和某些其他系统中,此值恰好为t2 - t1
os.difftime( newerTime, olderTime )
数字. 第一个时间参数。
数字. 第二个时间参数。
local olderTime = os.time() -- Print the elasped time local function dspTime() print( "Time elasped = " .. os.difftime( os.time(), olderTime ) ) end timer.performWithDelay( 2000, dspTime ) -- Wait 2 seconds before calling function