I used the method plusNanos()
: https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html#plusNanos-long-
// duration in Nanoseconds
var Long duration = 250000000
var Timer t = createTimer(now.plusNanos(duration), [|
logInfo("Created Timer","Timer finished. Sending command: " + cmd)
sendCommand(myItemName, commandToSend)
])
Note: I copied the code snipped from above from my Lambda function. Please be aware, that the used variables myItemName
and cmd
are locally defined as val
to be possible to pass them into the lambda function!