CreateTimer Documentation

Where do I find methods and public variables available in the Create Timer class?
Can I access anything like start time or duration in CreateTimer ?

createTimer is a script action that returns a Timer instance. Is that what you’re referring to?

To elaborate, createTimer is an Action that takes a Joda DateTime as there first argument and a lambda as the second argument. The lambda gets a complete copy of the current context when it is created (i.e can access global vars and Val’s and has a copy of all vars and vals defined in the rule up to that point).

The lambda does not know that it is being passed to a timer and had no way to discover this. It has no social access to anything special that isn’t available in your rule itself. There really is no such thing as “in createTimer”. It’s just a method call.

You can discover all available methods on an object using the ctrl-space key combo in ESH Designer. But I don’t remember there being anything to tell you when a timer has scheduled to run its lambda.

ok thanks , just checking there isn’t an easy way to get duration of timer .

No, there is such property as timeLeft or timeElapsed or so, but you can easily store the timestamp before starting the timer in a global var or even a number item (dateTime is a bit more complex as you can’t use joda time directly).