# How to use interval

**URL:** <https://forum.ionicframework.com/t/how-to-use-interval/148868>\
**Category:** ionic-v3\
**Created:** [November 28, 2018, 1:12pm UTC](https://forum.ionicframework.com/t/how-to-use-interval/148868 "2018-11-28T13:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmadkhaled123](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ahmadkhaled123](https://forum.ionicframework.com/u/ahmadkhaled123)\
**Post date:** [November 28, 2018, 1:12pm UTC](https://forum.ionicframework.com/t/how-to-use-interval/148868/1 "2018-11-28T13:12:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Judgewest2000](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/judgewest2000/32/113339_2.png) [@Judgewest2000](https://forum.ionicframework.com/u/Judgewest2000)\
**Post date:** [November 28, 2018, 7:05pm UTC](https://forum.ionicframework.com/t/how-to-use-interval/148868/2 "2018-11-28T19:05:55Z")

</div>

That’s more of a regular JavaScript type question.

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

Will run every three seconds.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:08pm UTC](https://forum.ionicframework.com/t/how-to-use-interval/148868/3 "2021-07-19T21:08:14Z")

</div>

Closed on July 19, 2021, 9:08pm UTC


