How to use timer - 10 common examples

To help you get started, we’ve selected a few timer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikedeboer / chromeless2 / test / loader / lib / addr.js View on Github external
tick = function () { 
   c++;
   node.innerHTML=c;  
 
console.log("+");
   timer.setTimeout( function () { tick() }, 1000);
}
github bradmartin / nativescript-texttospeech / demo / app / tns_modules / location / location-common.js View on Github external
locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                resolve(location);
            }
        }, function (error) {
            console.error('Location error received: ' + error);
            locationManager.stopLocationMonitoring();
            if ("undefined" !== typeof timerId) {
                timer.clearTimeout(timerId);
            }
            reject(error);
        }, options);
        if (options && ("number" === typeof options.timeout)) {
            timerId = timer.setTimeout(function () {
                locationManager.stopLocationMonitoring();
                reject(new Error("timeout searching for location"));
            }, options.timeout || defaultGetLocationTimeout);
        }
    });
};
github NativeScript / NativeScript / location / location-common.ts View on Github external
}
                resolve(location);
            }
        }, function (error: Error) {
                console.error('Location error received: ' + error);
                locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                reject(error);
            },
            options
            );

        if (options && ("number" === typeof options.timeout)) {
            timerId = timer.setTimeout(function () {
                locationManager.stopLocationMonitoring();
                reject(new Error("timeout searching for location"));
            }, options.timeout || defaultGetLocationTimeout);
        }
    });
}
github NativeScript / NativeScript / tns-core-modules / location / location-common.ts View on Github external
}
                resolve(location);
            }
        }, function (error: Error) {
                console.error('Location error received: ' + error);
                locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                reject(error);
            },
            options
            );

        if (options && ("number" === typeof options.timeout)) {
            timerId = timer.setTimeout(function () {
                locationManager.stopLocationMonitoring();
                reject(new Error("timeout searching for location"));
            }, options.timeout || defaultGetLocationTimeout);
        }
    });
}
github NativeScript / nativescript-app-templates / packages / template-hello-world / tns_modules / location / location-common.js View on Github external
locationManager.stopLocationMonitoring();
                if ("undefined" !== typeof timerId) {
                    timer.clearTimeout(timerId);
                }
                resolve(location);
            }
        }, function (error) {
            console.error('Location error received: ' + error);
            locationManager.stopLocationMonitoring();
            if ("undefined" !== typeof timerId) {
                timer.clearTimeout(timerId);
            }
            reject(error);
        }, options);
        if (options && ("number" === typeof options.timeout)) {
            timerId = timer.setTimeout(function () {
                locationManager.stopLocationMonitoring();
                reject(new Error("timeout searching for location"));
            }, options.timeout || defaultGetLocationTimeout);
        }
    });
};
github NativeScript / nativescript-sdk-examples-ng / app / ui-category / scroll-view / scroll-event / scroll-event.component.ts View on Github external
public onScroll(args: ScrollEventData) {
        this.status = "scrolling";

        setTimeout(() => {
            this.status = "not scrolling";
        }, 300);

        console.log("scrollX: " + args.scrollX);
        console.log("scrollY: " + args.scrollY);
    }
}
github taboca / TelaSocial / xulrunner / base / chrome / tagvisor / content / visor / com / taboca / calendar / calendar-icmc-3pane.js View on Github external
start : function () { 

	        this._raiseEvent(".container", "start");
                this._raiseEvent(".container.clock", "start");
                this._raiseEvent(".container.twitter", "start");
                this._raiseEvent(".container.uspmain", "start");
                this._raiseEvent(".container.redesocial", "start");
                this._raiseEvent(".bgsemana", "start");


                var self = this;
                timer.setTimeout( function(){self.kickMore()},1000);

		
	} ,
github taboca / TelaSocial / xulrunner / base / chrome / tagvisor / content / visor / org / icmc / clock / clock.js View on Github external
tick : function () {

		this.data = new Date();
		var text = this.data.toLocaleTimeString();
		text = text.replace(/:..( [AP]M)$/, '$1');
		this.element.innerHTML = text;

		var scopedThis = this;
		timer.setTimeout( function () { scopedThis.tick() }, 1000);

	},
github taboca / TelaSocial / xulrunner / base / chrome / tagvisor / content / visor / org / ifsc / calendar / calendar.js View on Github external
start : function () { 

	        this._raiseEvent(".container", "start");
                this._raiseEvent(".container.clock", "start");
                this._raiseEvent(".container.twitter", "start");
                this._raiseEvent(".container.typing", "start");
                this._raiseEvent(".container.fotos", "start");
                this._raiseEvent(".container.twitterslash", "start");
                this._raiseEvent(".container.destaque", "start");

                var self = this;
                timer.setTimeout( function(){self.kickMore()},1000);

		
	} ,
github taboca / TelaSocial / xulrunner / base / chrome / tagvisor / content / visor / org / fisl / calendar / calendar-projector.js View on Github external
start : function () { 

	        this._raiseEvent(".container", "start");
                this._raiseEvent(".container.clock", "start");
                this._raiseEvent(".container.weather", "start");
                this._raiseEvent(".container.flickr", "start");
                this._raiseEvent(".container.fislnews", "start");
                this._raiseEvent(".container.twitter_fisl", "start");
                this._raiseEvent(".container.twitter_fisl_oficial", "start");

                var self = this;
                timer.setTimeout( function(){self.kickMore()},1000);

		
	} ,

timer

timeout utilities (promisfied setTimeout, chained timeouts)

ISC
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Popular timer functions