##### Views

- Page
- Discussion
- View source
- History

# love.timer.getTime

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

### Synopsis

time = love.timer.getTime( )

### Arguments

None.

### Returns

`number time`
  The time in seconds.

## Examples

### Checking how long something takes

foo = ""
local stime = love.timer.getTime()
for i=1,1000 do
foo = foo .. "bar"
end
local etime = love.timer.getTime()
print(string.format("It took %.3f milliseconds to concatenate 'bar' 1000 times!", 1000 * (etime - stime)))

## See Also

- love.timer
- love.timer.getMicroTime

## Other Languages

Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – Tiếng Việt – 한국어
More info

Retrieved from "https://www.love2d.org/wiki/love.timer.getTime"
Categories: Templates | Functions

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Browse properties