|
|
@@ -405,7 +405,7 @@ jsmpeg.prototype.scheduleNextFrame = function() {
|
|
405
|
405
|
var wait = Math.max(0, (1000/this.pictureRate) - this.lateTime);
|
|
406
|
406
|
this.targetTime = Date.now() + wait;
|
|
407
|
407
|
|
|
408
|
|
- if(this.benchmark) {
|
|
|
408
|
+ if( this.benchmark ) {
|
|
409
|
409
|
var now = Date.now();
|
|
410
|
410
|
if(!this.benchframe) {
|
|
411
|
411
|
this.benchstart = now;
|
|
|
@@ -413,9 +413,11 @@ jsmpeg.prototype.scheduleNextFrame = function() {
|
|
413
|
413
|
}
|
|
414
|
414
|
this.benchframe++;
|
|
415
|
415
|
var timepassed = now - this.benchstart;
|
|
416
|
|
- if(this.benchframe >= 100) {
|
|
|
416
|
+ if( this.benchframe >= 100 ) {
|
|
417
|
417
|
this.benchfps = (this.benchframe / timepassed) * 1000;
|
|
418
|
|
- if(console) console.log("frames per second: " + this.benchfps);
|
|
|
418
|
+ if( console ) {
|
|
|
419
|
+ console.log("frames per second: " + this.benchfps);
|
|
|
420
|
+ }
|
|
419
|
421
|
this.benchframe = null;
|
|
420
|
422
|
}
|
|
421
|
423
|
setTimeout( this.nextFrame.bind(this), 0);
|