瀏覽代碼

Cosmetics

Dominic Szablewski 12 年之前
父節點
當前提交
3dbbcb99b8
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      jsmpg.js

+ 5 - 3
jsmpg.js 查看文件

405
 	var wait = Math.max(0, (1000/this.pictureRate) - this.lateTime);
405
 	var wait = Math.max(0, (1000/this.pictureRate) - this.lateTime);
406
 	this.targetTime = Date.now() + wait;
406
 	this.targetTime = Date.now() + wait;
407
 
407
 
408
-	if(this.benchmark) {
408
+	if( this.benchmark ) {
409
 		var now = Date.now();
409
 		var now = Date.now();
410
 		if(!this.benchframe) {
410
 		if(!this.benchframe) {
411
 			this.benchstart = now;
411
 			this.benchstart = now;
413
 		}
413
 		}
414
 		this.benchframe++;
414
 		this.benchframe++;
415
 		var timepassed = now - this.benchstart;
415
 		var timepassed = now - this.benchstart;
416
-		if(this.benchframe >= 100) {
416
+		if( this.benchframe >= 100 ) {
417
 			this.benchfps = (this.benchframe / timepassed) * 1000;
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
 			this.benchframe = null;
421
 			this.benchframe = null;
420
 		}
422
 		}
421
 		setTimeout( this.nextFrame.bind(this), 0);
423
 		setTimeout( this.nextFrame.bind(this), 0);