> For the complete documentation index, see [llms.txt](https://docs.novarietygames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novarietygames.com/websitecreator/luascript/setinterval.md).

# setInterval

setInterval is just LUA native `delay` expect it runs infinitely every timeout

setInterval takes **2** arguments, the function and numeric timeout in seconds

setInterval **returns** the **interval timeout ID,** you can use this to stop the interval using [clearInterval](/websitecreator/luascript/clearinterval.md)

```lua
local Age = 1
setInterval(function()
    Age = Age + 1
    print("You are " .. Age .. " years old")
end, 5) -- every 5 seconds this will print the current Age
```
