Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a setInterval kind of thing in roku

Hi All,

Does any one have any idea on how we can achieve something like setInterval in roku?

Regards,
Prajwal
0 Kudos
2 REPLIES 2
RokuMarkn
Visitor

Re: How to create a setInterval kind of thing in roku

Assuming you mean that you want to execute a function periodically, see the "Timed events" section in the Event Loops documentation.

--Mark
0 Kudos
Komag
Roku Guru

Re: How to create a setInterval kind of thing in roku

One way to approach it: Basically while your main loop is running, have a roTimespan counting up, and check it every loop. Once it's as large as you want (seconds or milliseconds), do what you want and reset the counter to 0.
0 Kudos