Repeat code every second

How would I repeat some code every second? I’ve tried looking into timers but couldn’t properly understand these.
It would be awesome if someone could provide a code example of how I could accomplish this.

local function boom(self, handle, time_elapsed)
    print("boom")
end

function init(self)
    timer.delay(1, true, boom)
end

or

function init(self)
    timer.delay(1, true, function(self, handle, time_elapsed)
        print("boom")
    end)
end
2 Likes

I found my issue. Thanks!

1 Like