Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
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
RokuMarkn
Level 7

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
Level 9

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