B2G/gecko/testing/peptest/peptest/extension/resource/pep/utils.js
/**
 * Sleep for the given amount of milliseconds
 *
 * @param {number} milliseconds
 * Sleeps the given number of milliseconds
 */
Sleep for the given amount of milliseconds
@param {number} milliseconds
Sleeps the given number of milliseconds
Sleep for the given amount of milliseconds @param { number } milliseconds Sleeps the given number of milliseconds
function sleep(milliseconds) {
  var timeup = false;
  function wait() { timeup = true; }
  hwindow.setTimeout(wait, milliseconds);
  var thread = Components.classes["@mozilla.org/thread-manager;1"].
               getService().currentThread;
  while(!timeup) {
    thread.processNextEvent(true);
  }
}
function sleep ( milliseconds ) { var timeup = false ; function wait ( ) { timeup = true ; } hwindow . setTimeout ( wait , milliseconds ) ; var thread = Components . classes [ "@mozilla.org/thread-manager;1" ] . getService ( ) . currentThread ; while ( ! timeup ) { thread . processNextEvent ( true ) ; } }
Sleep for the given amount of milliseconds
 @param {number} milliseconds
 Sleeps the given number of milliseconds
Sleep for the given amount of milliseconds @param { number } milliseconds Sleeps the given number of milliseconds
// We basically just call this once after the specified number of milliseconds