var timeoutID;
var timeInMilliseconds = 2000;
function delayedAlert() {
timeoutID = window.setTimeout(slowAlert, timeInMilliseconds);
}
function slowAlert() {
// 2000 passed, do something here
}
This can be just a simple Javascript timeout call. You don't need an app for this.