# Is there any function could disable and enable timer?

**URL:** <https://forums.openmv.io/t/is-there-any-function-could-disable-and-enable-timer/11001>\
**Category:** OpenMV Boards\
**Created:** [May 12, 2025, 12:21am UTC](https://forums.openmv.io/t/is-there-any-function-could-disable-and-enable-timer/11001 "2025-05-12T00:21:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjh2100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/sjh2100/32/2979_2.png) [@sjh2100](https://forums.openmv.io/u/sjh2100)\
**Post date:** [May 12, 2025, 12:21am UTC](https://forums.openmv.io/t/is-there-any-function-could-disable-and-enable-timer/11001/1 "2025-05-12T00:21:24Z")

</div>

is there any function could disable timer?  
for example Timer 2 runs with counts=100, now i disable the timer 2 ,i want to timer 2 pause,then i handle some code. after that code,i enable the timer 2, i want timer 2 could keep running start from counts 100.  
‘’’  
disable the timer 2(timer 2 maybe counts =100,now it pause)  
myfun()  
enable the timer 2(keep running)  
‘’’

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [May 12, 2025, 1:50am UTC](https://forums.openmv.io/t/is-there-any-function-could-disable-and-enable-timer/11001/2 "2025-05-12T01:50:11Z")

</div>

Timers have a deinit() and init() method. When you reinit you can pass new settings:

> <https://github.com/openmv/micropython/blob/1a472061e9457236adc8ec148b4bf88c289aab52/extmod/machine_timer.c#L44>

---

<div class="post-metadata">

**Author:** ![sjh2100](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/sjh2100/32/2979_2.png) [@sjh2100](https://forums.openmv.io/u/sjh2100)\
**Post date:** [May 12, 2025, 12:08pm UTC](https://forums.openmv.io/t/is-there-any-function-could-disable-and-enable-timer/11001/3 "2025-05-12T12:08:12Z")

</div>

roger that ，thank u
