Sleep (pause execution)

function Sleep(millisec: number)

Unlike many other programming languages, JavaScript doesn’t really have a native sleep function (although there are several ways to implement it, for those willing to spend a few lines of code on it). This utility function just makes it much easier to pause the execution of an aftJS script for a certain number of milliseconds, when needed.