# IntervalTimer library

**URL:** <https://community.particle.io/t/intervaltimer-library/3004>\
**Category:** Libraries\
**Created:** [February 20, 2014, 11:36pm UTC](https://community.particle.io/t/intervaltimer-library/3004 "2014-02-20T23:36:40Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [March 27, 2014, 8:29pm UTC](https://community.particle.io/t/intervaltimer-library/3004/8 "2014-03-27T20:29:11Z")

</div>

OK folks, it is DONE!! The SparkIntervalTimer library is now available for all your grubby little hands. I consider this a start but right now, you can grab an interval timer from a pool of three (TIM2, TIM3 or TIM4), pass it a callback and give it a period and it calls your code at that interval. When your done, the timer is returned to the pool. Due to the way the timers work, there are two timescales - 1-65535 microseconds and 1-65535 half milliseconds (or max of 32767 milliseconds). The code could be adapted to setup the timers for PWM also but that can come later. The code compiles both locally and on the web IDE.

If you are interested, the [**code is available on my github**](https://github.com/pkourany/Spark-Interval-Timer). Your feedback and ideas are greatly appreciated. 😃

---

_[View the full topic](https://community.particle.io/t/intervaltimer-library/3004)._
