Reference

Polling

OtherEvergreenPublic

You do a certain operation in a specified interval for a long time or until a specific action. The most direct approach would be using setInterval but then you need to make sure to also clearInterval at the right time.