Delete a timer.
This function generates an event.
del_timer(timer)
Argument | Type | Description |
---|---|---|
timer | int (required) | Timer Id to delete. |
Returns nil
when successful. A lookup_err() is raised if the timer does not exist.
This code will will update
.counter
by one each minute. After 10 minutes the counter has reached 10 and will delete itself.
.counter = 0;
new_timer(
datetime(),
60,
|timer| {
.counter += 1;
if (.counter == 10, {
del_timer(timer); // stop this timer
});
}
);