# Next expire timer and timer period in ticks

**URL:** <https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348>\
**Category:** Kernel\
**Created:** [July 31, 2018, 12:34pm UTC](https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348 "2018-07-31T12:34:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 31, 2018, 12:34pm UTC](https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348/1 "2018-07-31T12:34:54Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Tuesday, July 31, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b708ae11/#3f32):

Hi,

What is the difference between Next expire timer (xNextExpireTime) and timer period in ticks (pxTimer-\>xTimerPeriodInTicks) ?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 31, 2018, 3:57pm UTC](https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348/2 "2018-07-31T15:57:07Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, July 31, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b708ae11/#3f32/eb12):

There is little context to your question, but I’m going to guess the  
next expire time is the time at which the timer callback function will  
execute, while the timer period is the frequency at which the callback  
function executes.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 1, 2018, 6:48am UTC](https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348/3 "2018-08-01T06:48:06Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, August 01, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b708ae11/#aa31):

Is next expire timer is relative to xTickCount ?

Is the next equation is correct :

**xNextExpireTime = xTickCount + xTimerPeriodInTicks**

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [August 1, 2018, 10:44am UTC](https://forums.freertos.org/t/next-expire-timer-and-timer-period-in-ticks/7348/4 "2018-08-01T10:44:26Z")

</div>

**[richarddamon](https://sourceforge.net/u/richarddamon/)** wrote on [Wednesday, August 01, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/b708ae11/#4ef3):

xNextExpireTime would be an absolute time (but relative to the wrap around period of the tick count). xTickCount is the current time as a absolute tick count, and xTimerPeriodInTicks would be an interval expressed in ticks.

For example, if you have a 100 Hz Tick Rate, and FreeRTOS has been running for 10 seconds, the current time would be 10\*100 = 1000. If you want to set a timer for 1 second (100 ticks) then the expire time would be 1000 + 100 = 1100.
