How to use interval

Hello , I am new to programming and ionic . I doing an education app . I want to user to put the interrupt interval time. For example, if user set 5 minutes, and click on button ,every 5 minutes the question will appear.and when need to stop the interval should click on the same button.
could please help me with the function.

1 Like

That’s more of a regular JavaScript type question.

setInterval(() => console.log(‘done’), 3000);

Will run every three seconds.