Is there a timer function?

Hi, I’m searching for a timer function that runs independently and perpetually in the background and triggers an event every time it runs out. Is there such a thing in Wix? If not, is there a way to code one?

The idea is I want something to happen every, say, 2 seconds.

See https://www.w3schools.com/js/js_timing.asp , the setInterval() function.