In the Smartface, it is possible to run a code in a separate thread using the same methods in Web development: setTimeout and setInterval.
This function calls the parameter function only once after the initial duration.
This function calls the parameter function repeating in the given period.
Required. The function that will be executed.
Required. The time duration in milliseconds to wait before executing the code, i.e. for setTimeout function, or the period of execution, i.e. for setInterval function.
A number, integer value of the ID or the job. This value is used while cancelling the job.
Cancelling of a job can be done by using one of the two functions (clearTimeout or clearInterval). Those two functions do the same work, "clear / cancel" the job with the given ID.
clearTimeout can cancel the job of setInterval. clearInterval can cancel the job of setTimeout or vice versa.