Is it possible to call setTimeout or an equivalent function in Google Apps Scripts?

When I try to run the following code:

<!-- language: lang-js -->
function onSubmit() {
  // we've been called, remove trigger, set timeout, re-enable, and then run function
  destroySubmitHandler();
  setTimeout(function() {
    createSubmitHandler();
    myFunction()
  }, 5 * 1000)
}

I get the following error:

screenshot

Apparently you can use the function Utilities.sleep() like this:

<!-- language: lang-js -->
function onSubmit() {
  // we've been called, remove trigger, set timeout, re-enable, and then run function
  destroySubmitHandler();
  Utilities.sleep(5 * 1000)
  createSubmitHandler();
  myFunction()
}