$.wait(group, timeout ,callback)

Description: Wait for a given amount of time before continuing method invocation in a named thread group.

group – string, optional
a name of the thread group that this waiting should be assigned to.
Defaults to the empty string ''.
timeout – number
the number of milliseconds to wait for.
A value of null or 0 means the shortest possible timeout that the browser provides via window.setTimeout().
callback – function(), optional
a method that is called once after the timeout.

The static $.unwait() allows to break wait states defined this way.


Usage pattern

$.wait(timeout, function(){  });
$.wait(first-timeout, function(){  })
  .wait(second-timeout, function(){  })
  .wait(third-timeout, function(){  });