Studio

Z.after(...)

Z.after(ms: number, func: () => void): void;

Runs a function after the specified time has passed. This may occur some number of milliseconds beyond the specified interval due to variable frame times.

Parameters

Parameter Type Description
ms number The number of milliseconds that must have elapsed before the function will be called.
func function The function to be called once the interval has elapsed.

Example

function myFunction(){
    //a function to call
}
//call the funtion myFunction after 1000ms (1 second)
Z.after(1000, myFunction);
Open in new window