pe:timer with milliseconds [Solved]
Posted: 29 Jan 2019, 18:39
Is there a way to run pe:timer with milliseconds than seconds?
I need to run a timer each 100 milliseconds.
Thanks
I need to run a timer each 100 milliseconds.
Thanks
Code: Select all
PrimeFaces.widget.ExtTimer.prototype.start = function() {
var that = this;
var end;
this.prevTime = this.currentTimeInSecs();
if(!this.interval){
this.interval = setInterval(function(){
that.doStep();
end = that.forward ? that.currentTimeout >= that.originalTimeout : that.currentTimeout <= 0;
if(end){
if(that.cfg.listener){
that.cfg.listener();
}
if(that.cfg.ontimercomplete){
that.cfg.ontimercomplete();
}
if(that.cfg.singleRun){
clearInterval(that.interval);
this.interval = null;
}else{
that.currentTimeout = that.forward ? 0 : that.originalTimeout;
that.print();
}
}
}, 100);
}
}