diff options
Diffstat (limited to 'meta/3rd/lovr/library/lovr.timer.lua')
-rw-r--r-- | meta/3rd/lovr/library/lovr.timer.lua | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/meta/3rd/lovr/library/lovr.timer.lua b/meta/3rd/lovr/library/lovr.timer.lua index b4693e4c..4bcb02f1 100644 --- a/meta/3rd/lovr/library/lovr.timer.lua +++ b/meta/3rd/lovr/library/lovr.timer.lua @@ -1,7 +1,9 @@ ---@meta --- ----The `lovr.timer` module provides a few functions that deal with time. All times are measured in seconds. +---The `lovr.timer` module provides a few functions that deal with time. +--- +---All times are measured in seconds. --- ---@class lovr.timer lovr.timer = {} @@ -13,7 +15,15 @@ lovr.timer = {} function lovr.timer.getAverageDelta() end --- ----Returns the time between the last two frames. This is the same value as the `dt` argument provided to `lovr.update`. +---Returns the time between the last two frames. +--- +---This is the same value as the `dt` argument provided to `lovr.update`. +--- +--- +---### NOTE: +---The return value of this function will remain the same until `lovr.timer.step` is called. +--- +---This function should not be used to measure times for game behavior or benchmarking, use `lovr.timer.getTime` for that. --- ---@return number dt # The delta time, in seconds. function lovr.timer.getDelta() end @@ -25,19 +35,25 @@ function lovr.timer.getDelta() end function lovr.timer.getFPS() end --- ----Returns the time since some time in the past. This can be used to measure the difference between two points in time. +---Returns the time since some time in the past. +--- +---This can be used to measure the difference between two points in time. --- ---@return number time # The current time, in seconds. function lovr.timer.getTime() end --- ----Sleeps the application for a specified number of seconds. While the game is asleep, no code will be run, no graphics will be drawn, and the window will be unresponsive. +---Sleeps the application for a specified number of seconds. +--- +---While the game is asleep, no code will be run, no graphics will be drawn, and the window will be unresponsive. --- ---@param duration number # The number of seconds to sleep for. function lovr.timer.sleep(duration) end --- ----Steps the timer, returning the new delta time. This is called automatically in `lovr.run` and it's used to calculate the new `dt` to pass to `lovr.update`. +---Steps the timer, returning the new delta time. +--- +---This is called automatically in `lovr.run` and it's used to calculate the new `dt` to pass to `lovr.update`. --- ---@return number delta # The amount of time since the last call to this function, in seconds. function lovr.timer.step() end |