-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtimer.lua
More file actions
40 lines (32 loc) · 1.26 KB
/
timer.lua
File metadata and controls
40 lines (32 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
--
-- Provides an interface to the user's clock.
--
-- @module timer
--
---
-- Returns the time between the last two frames.
-- @function [parent = #timer] getDelta
-- @return #number dt The time passed (in seconds).
---
-- Returns the current frames per second.
--
--Displaying the FPS with love.graphics.print or love.graphics.setCaption can have an impact on this value. Keep this in mind while benchmarking your game.
-- @function [parent = #timer] getFPS
-- @return #number fps The current FPS.
---
-- Returns the value of a timer with an unspecified starting time. The time is accurate to the microsecond.
-- @function [parent = #timer] getMicroTime
-- @return #number t The time passed in seconds.
---
-- Returns the value of a timer with an unspecified starting time. This function should only be used to calculate differences between points in time, as the starting time of the timer is unknown.
-- @function [parent = #timer] getTime
-- @return #number time The time in seconds.
---
-- Sleeps the program for the specified amount of time.
-- @function [parent = #timer] sleep
-- @param #number s Seconds to sleep for.
---
-- Measures the time between two frames. Calling this changes the return value of love.timer.getDelta.
-- @function [parent = #timer] step
return nil