Parcourir la source

fix printing to console for Internet Explorer 10, make fps available via this.benchfps

Maik Merten il y a 12 ans
Parent
révision
51523e78ac
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      jsmpg.js

+ 2 - 1
jsmpg.js Voir le fichier

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
-			if(console) console.debug("frames per second: " + (this.benchframe / timepassed) * 1000 );
417
+			this.benchfps = (this.benchframe / timepassed) * 1000;
418
+			if(console) console.log("frames per second: " + this.benchfps);
418
 			this.benchframe = null;
419
 			this.benchframe = null;
419
 		}
420
 		}
420
 		setTimeout( this.nextFrame.bind(this), 0);
421
 		setTimeout( this.nextFrame.bind(this), 0);