// +++++++++++++++++++++++++++++++++++++++ // ++ Objeto Temporizador por Rolf Ruiz // ++ Temporizer Object by Rolf Ruiz // ++ December, 2001 // ++ Alesys.net :: Neo Bug Edition // +++++++++++++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++ Sintaxis/Syntax : // tempo = new temporizador(seconds); // 'seconds' is the number of seconds u want to wait, it can be a float number. // // 'seconds' es el número de segundos que quieres esperar, puede ser un número de punto flotante. // tempo.alto(false); // returns 'true' when the time is over. // // regresa 'true' cuando el tiempo termina. // tempo.alto(true); // returns 'true' when the time is over, and starts the count again. // // regresa 'true' cuando el tiempo termina, y comienza la cuenta otra vez. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function temporizador (segundos){ if (!this.inicio){ this.inicio = true ; this.segundos = segundos * 1000 ; this.tFinal = getTimer() + this.segundos ; } } temporizador.prototype.alto = function(renovar){ var renovar = renovar if (this.tFinal <= getTimer()){ if (renovar){ this.tFinal = getTimer() + this.segundos ; } return true ; } else { return false ; } }