# Using Timer Class in Rule Making

**URL:** <https://community.openhab.org/t/using-timer-class-in-rule-making/35080>\
**Category:** Scripts & Rules\
**Created:** [October 13, 2017, 4:54am UTC](https://community.openhab.org/t/using-timer-class-in-rule-making/35080 "2017-10-13T04:54:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![binderth](https://community.openhab.org/user_avatar/community.openhab.org/binderth/32/56257_2.png) [@binderth](https://community.openhab.org/u/binderth)\
**Post date:** [October 13, 2017, 8:04am UTC](https://community.openhab.org/t/using-timer-class-in-rule-making/35080/4 "2017-10-13T08:04:26Z")

</div>

as for the timer Syntax, mine _were_ like Olymp wrote (make sure to place the ] after resetting the timer).

**alternative approach: using expire binding instead of timer**  
a small hint, if you’re thinking of using more timers, use expire functionality…  
I replaced my timers with an easier to read and implement design pattern using the expire binding:

> [@Design Pattern: Expire Binding Based Timers](https://community.openhab.org/t/design-pattern-expire-binding-based-timers/32634):
>
> Problem Statement One often needs to schedule some code to execute at some time in the future. The “usual” way to achieve this is by using a Timer which lets you create and schedule a lambda to execute at a given date and time. However, Timers have their drawbacks including: the need to keep track of open Timers so they can be canceled at a later date, often requiring the use of HashMaps or some other data structure rescheduling or creating a cascade of Timers is challenging (i.e. when a tim…

This way, it’s much easier to comprehend the purpose of the timer - even after returning to your Code after some days/week/months/… 😉

---

_[View the full topic](https://community.openhab.org/t/using-timer-class-in-rule-making/35080)._
