This is the ThingsDB documentation for version v0, click here for the latest version!
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
.counterby 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
        });
    }
);