10 examples of 'typescript settimeout' in JavaScript

Every line of 'typescript settimeout' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
127function _setTimeout(fn, ms) {
128 var start = Date.now();
129
130 process.nextTick(fakeSetTimeout);
131
132 function fakeSetTimeout() {
133 if (Date.now() < start + ms) {
134 process.nextTick(fakeSetTimeout);
135 return;
136 }
137
138 fn();
139 }
140}
58setTimeout (ms){
59 this.timeout = ms ;
60}
43function setTimeout(func,millis){
44 var guid = getRandomName(10);
45 Gtlym.CALL["interval_"+guid] = func;
46 return app.scheduleTask('Gtlym.CALL["interval_'+guid+'"]();',millis,false);
47}
474Stream.prototype.setTimeout = function setTimeout(time) {};
363setTimeout: function setTimeout(timeout, callback) {
364 console.warn('setTimeout not implemented yet');
365},
33_setTimeout(callback, time) {
34 this._timer = setTimeout(() => {
35 callback()
36 this._finish = true
37 this._rest = null
38 }, time / this._rate)
39
40 this._finish = false
41 this._time = time
42 this._startTime = new Date()
43 this._callback = callback
44 this._rest = null
45}
9static setTimeout(fn, millis) {
10 return global.setTimeout(fn, millis);
11}
552client.setTimeout = function setTimeout(t) {
553 client._queryTimeout = t;
554};
29export function setTimeout(f: Function, time: number, ...args: any[]) {
30 if (time === 0) {
31 f(args);
32 return -1;
33 } else {
34 return window.setTimeout(f, time, args);
35 }
36}
11this.setTimeout = function setTimeout(func, delay, ...args) {
12 if (typeof delay !== "number" || delay < 0) delay = 0;
13 return timeout_add(PRIORITY_DEFAULT, delay, () => {
14 func.apply(null, args);
15 return false;
16 });
17};

Related snippets