普通错误setTimeout id 
失败异常处理
189691
function errorCbHandler(errorCb, delayTime) {
    //uc现在打不开了
    if(isUC){
        isRuning = false;
        errorCb();
    }else if (isSafari) {
        //ios8 以上后台setInterval 确定会被 滞后执行，
        //但是android因为是多线程的所以貌似不行的  uc浏览器也有同样的问题
        //android 浏览器 测试uc
        //总计倒计时2s
        //ios 会弹出来一个确认对话框，因此 多加1000 延迟
        var count = Math.floor((delayTime + 1000) / 10);
        var tmpCount = count;
        var currentTime = new Date().getTime();
        var ios8UpIde = setInterval(function() {
            count--;
            if (count === 0) {
                clearInterval(ios8UpIde);
                if (new Date().getTime() - currentTime < (tmpCount * 10 + 500)) {
                    errorCb();
                }
                isRuning = false;
            }
        }, 10);
    } else {
        errorIde = setTimeout(function() {
            isRuning = false;
            if (!document.hidden) {
                errorCb();
            }
        }, delayTime);
    }
}
1178659
function(callback) {
        waitForSocketToConnectTimeoutId && clearTimeout(waitForSocketToConnectTimeoutId);

        if (socket.readyState === 1) {
          callback();
        } else {
          waitForSocketToConnectTimeoutId = setTimeout(function() {
            if (socket.readyState === 1) {
              callback();
            } else {
              waitForSocketToConnect(callback);
            }
          }, wsConnectionWaitTime);
        }
      }
1079047
function (selector, callbackFn, timeout) {
                    var self = this,
                        startTime = Date.now(),
                        timeoutInterval = 150,
                        testRunning = false,
                    //if evaluate succeeds, invokes callback w/ true, if timeout,
                    // invokes w/ false, otherwise just exits
                        testForSelector = function () {

                            var elapsedTime = Date.now() - startTime;

                            if (elapsedTime > timeout) {
                                self.options.debug && console.log('warning: timeout occurred while waiting for selector:"%s"'.yellow, selector);
                                callbackFn(false);
                                return;
                            }

                            self.evaluate(function (selectorToEvaluate) {
                                return document.querySelectorAll(selectorToEvaluate).length;
                            }, function (result) {
                                testRunning = false;
                                if (result > 0) {//selector found
                                    callbackFn(true);
                                }
                                else {
                                    setTimeout(testForSelector, timeoutInterval);
                                }
                            }, selector);
                        };

                    timeout = timeout || 10000; //default timeout is 2 sec;
                    setTimeout(testForSelector, timeoutInterval);
                }
311385
public void setTimeout(long timeout, TimeUnit unit) {
        this.timeout = timeout;
        this.unit    = unit;
        c.setTimeout(timeout, unit);
    }
1300253
function setIntervalContext(fn, ctx, timeout) {
  var id;

  var cancel = function() {
    clearInterval(id);
  };

  id = setInterval(function() { fn(); }, timeout);

  ctx.once('cancel', cancel);
}
1362585
function(callback, timeInMs) {
    var timeout = makeTimeout(function() {
      setTriggerTime(timeout, timeout.timeInMs);
      s_timeoutsToInsert.push(timeout);
      callback();
    });
    timeout.timeInMs = timeInMs;
    s_timeoutsToInsert.push(timeout);
    return timeout.id;
  }
866904
function startControlsTimeOut () {

      clearTimeout(controlsTimeout);

      if (controlsElement.style.display === "block") {
        controlsTimeout = setTimeout(function () {
          toggleControls();
        }, 5000);
      } else {
        toggleControls();
      }
    }
128238
function() {
    var self = this;
    var display = (playlist.style.display === 'block') ? 'none' : 'block';

    setTimeout(function() {
      playlist.style.display = display;
    }, (display === 'block') ? 0 : 500);
    playlist.className = (display === 'block') ? 'fadein' : 'fadeout';
  }
814918
function onTimeout() {
    const listenerCount = socket.listeners('timeout').length;
    debug('%s(requests: %s, finished: %s) timeout after %sms, listeners %s',
      socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT],
      getSocketTimeout(socket), listenerCount);
    agent.timeoutSocketCount++;
    const name = agent.getName(options);
    if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) {
      // free socket timeout, destroy quietly
      socket.destroy();
      // Remove it from freeSockets list immediately to prevent new requests
      // from being sent through this socket.
      agent.removeSocket(socket, options);
      debug('%s is free, destroy quietly', socket[SOCKET_NAME]);
    } else {
      // if there is no any request socket timeout handler,
      // agent need to handle socket timeout itself.
      //
      // custom request socket timeout handle logic must follow these rules:
      //  1. Destroy socket first
      //  2. Must emit socket 'agentRemove' event tell agent remove socket
      //     from freeSockets list immediately.
      //     Otherise you may be get 'socket hang up' error when reuse
      //     free socket and timeout happen in the same time.
      if (listenerCount === 1) {
        const error = new Error('Socket timeout');
        error.code = 'ERR_SOCKET_TIMEOUT';
        error.timeout = getSocketTimeout(socket);
        // must manually call socket.end() or socket.destroy() to end the connection.
        // https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_socket_settimeout_timeout_callback
        socket.destroy(error);
        agent.removeSocket(socket, options);
        debug('%s destroy with timeout error', socket[SOCKET_NAME]);
      }
    }
  }
67695
public void setTimeout(String value) {

        try {
            setTimeout(Long.parseLong(value));
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(Messages.LOG_PARSE_TIMEOUT_FAILED_2, value, new Long(DEFAULT_TIMEOUT)),
                e);
            setTimeout(DEFAULT_TIMEOUT);
        }
    }
15345
function completePreDefine( currentId ) {
        // HACK: 这里在IE下有个性能陷阱，不能使用任何变量。
        //       否则貌似会形成变量引用和修改的读写锁，导致wait4PreDefine释放困难
        each( wait4PreDefine, function ( module ) {
            //needAnalyse = 1;
            modPreDefine(
                currentId,
                module.deps,
                module.factory
            );
        } );

        wait4PreDefine.length = 0;
        modAnalyse();
    }
931573
function Timer(timeout, timeoutCallback) {
  this.finalTime = false;
  this.time = Date.now();
  this.TimerFunction = setTimeout(timeoutCallback, timeout);
}
225268
function( timeout, callback ) {
			if ( typeof timeout === 'function' ) {
				callback = timeout;
				timeout = null;
			}
			timeout = timeout || 600;
			var self = this;
			this.queue.unshift(function() {
				setTimeout(function() {
					callback && callback.apply(self, [])
					self.done.apply(self, arguments);
				}, timeout);
			});
			return this;
		}
334662
function(id) {
        // Stop javascript timer & remove from timer list
        if (id && timers[id]) {
            window.clearInterval(timers[id].timer);
            removeListeners(timers[id].listeners);
            delete timers[id];
        }
    }
892622
private void setTimeoutOnSelenium() {
		executeCommand("setTimeout", new String[] { "" + this.timeout });
        WebDriver.Timeouts timeouts = getWebDriver().manage().timeouts();
        timeouts.setScriptTimeout(this.timeout, TimeUnit.MILLISECONDS);
        timeouts.pageLoadTimeout(this.timeout, TimeUnit.MILLISECONDS);
	}
407422
function() {
      // Timeouts are routed through the parent window, because on
      // some browsers designMode windows do not fire timeouts.
      var self = this;
      this.parent.clearTimeout(this.highlightTimeout);
      this.highlightTimeout = this.parent.setTimeout(function(){self.highlightDirty();}, this.options.passDelay);
    }
773149
function listenFor (event, listener, context, duration) {
    setTimeout(function () {
        this.off(event, listener, context);
    }.bind(this), duration);
    this.on(event, listener, context);
}