<commit_before>// Namespace
this.Fizz = this.Fizz || { };

(function() {

	var RAFRenderer = Object.extend({

		init: function(stage, framerate, logFPS) {

			this._stage = null;
			this._framerate = RAFRenderer.DEFAULT_FRAME_RATE;
			this._actualFramerate = 0;
			this._logFPS = false;
			this._rendering = false;
			this._lastRenderTime = 0;
			this._RAFCallbackHandle = null;

			this.stage = stage;
			this.framerate = framerate;
			this.logFPS = logFPS;

		},

		startRendering: function() {

			if(this._rendering || null === this._stage) return;
			
			this._rendering = true;
			this._lastRenderTime = +new Date();

			var RAFMethod = this._getRAFMethod();

			// Recursive 'render' callback function (binds 'this')
			var render = function(now) {

				this._actualFramerate = now - this._lastRenderTime;

				if(this._logFPS && 0 === (now & (64 - 1))) {
					console.log(
						"Rendering at",
						(1000 / this._actualFramerate).toFixed(2),
						"frames per second"
					);
				}

				this._stage.draw();

				// Update the last render time to the present

				this._lastRenderTime = now;

				// We'll need to pass a callback wrapper that returns
				// a time-sensitive invocation of the 'render' callback

				var callback_wrapper = (function() { 	//domHighResTimeStamp
					render.call(this, +new Date());				
				}).bind(this);

				this._RAFCallbackHandle = RAFMethod.call(
					window,
					callback_wrapper,
					this._framerate // Won't be required by actual RAF methods
				);
					
			}.bind(this);

			render(this._lastRenderTime);

		},

		stopRendering: function() {

			if(!this._rendering) return;

			this._rendering = false;

			var cancelAnimationFrame = this._getCAFMethod();
				cancelAnimationFrame(this._RAFCallbackHandle);

		},

		toString: function() {
			return "[RAFRenderer (rendering='" + this._rendering.toString() + "', " +
								 "framerate='" + this._framerate.toFixed(2) + "', " +
								 "logFPS='" + this._logFPS.toString() + "')]";
		},

		// Private methods

		_getRAFMethod: function() {

			return window.requestAnimationFrame ||
				   window.mozRequestAnimationFrame ||
				   window.webkitRequestAnimationFrame ||
				   window.msRequestAnimationFrame ||
				   window.setTimeout;

		},

		_getCAFMethod: function() {

			return window.cancelAnimationFrame ||
				   window.mozCancelAnimationFrame ||
				   window.webkitCancelAnimationFrame ||
				   window.msCancelAnimationFrame ||
				   window.clearTimeout;

		}

	});

	// Static class members

	RAFRenderer.DEFAULT_FRAME_RATE = (1000 / 60); // 60fps

	// Public properties

	RAFRenderer.prototype.exposeProperty("rendering");
	RAFRenderer.prototype.exposeProperty("actualFramerate");

	RAFRenderer.prototype.exposeProperty("stage", "_stage",
		Fizz.restrict.toInstanceType("_stage", "Fizz.Stage"));

	RAFRenderer.prototype.exposeProperty("framerate", "_framerate",
		Fizz.restrict.toRange("_framerate", [10, Infinity]));
	
	RAFRenderer.prototype.exposeProperty("logFPS", "_logFPS",
		Fizz.restrict.toBoolean("_logFPS"));

	// Class export
	Fizz.RAFRenderer = RAFRenderer;

}());<commit_msg>Added 'actualFPS' getter method to RAFRenderer class;<commit_after>// Namespace
this.Fizz = this.Fizz || { };

(function() {

	var RAFRenderer = Object.extend({

		init: function(stage, framerate, logFPS) {

			this._stage = null;
			this._framerate = RAFRenderer.DEFAULT_FRAME_RATE;
			this._actualFramerate = 0;
			this._logFPS = false;
			this._rendering = false;
			this._lastRenderTime = 0;
			this._RAFCallbackHandle = null;

			this.stage = stage;
			this.framerate = framerate;
			this.logFPS = logFPS;

		},

		startRendering: function() {

			if(this._rendering || null === this._stage) return;
			
			this._rendering = true;
			this._lastRenderTime = +new Date();

			var RAFMethod = this._getRAFMethod();

			// Recursive 'render' callback function (binds 'this')
			var render = function(now) {

				this._actualFramerate = now - this._lastRenderTime;

				if(this._logFPS && 0 === (now & (64 - 1))) {
					Fizz.logger
						.filter("all")
						.log("Rendering {0} frames per seconds",
							  (1000 / this._actualFramerate).toFixed(2));
				}

				this._stage.draw();

				// Update the last render time to the present

				this._lastRenderTime = now;

				// We'll need to pass a callback wrapper that returns
				// a time-sensitive invocation of the 'render' callback

				var callback_wrapper = (function() { 	//domHighResTimeStamp
					render.call(this, +new Date());				
				}).bind(this);

				this._RAFCallbackHandle = RAFMethod.call(
					window,
					callback_wrapper,
					this._framerate // Won't be required by actual RAF methods
				);
					
			}.bind(this);

			render(this._lastRenderTime);

		},

		stopRendering: function() {

			if(!this._rendering) return;

			this._rendering = false;

			var cancelAnimationFrame = this._getCAFMethod();
				cancelAnimationFrame(this._RAFCallbackHandle);

		},

		toString: function() {
			return "[RAFRenderer (rendering='" + this._rendering.toString() + "', " +
								 "framerate='" + this._framerate.toFixed(2) + "', " +
								 "logFPS='" + this._logFPS.toString() + "')]";
		},

		// Private methods

		_getRAFMethod: function() {

			return window.requestAnimationFrame ||
				   window.mozRequestAnimationFrame ||
				   window.webkitRequestAnimationFrame ||
				   window.msRequestAnimationFrame ||
				   window.setTimeout;

		},

		_getCAFMethod: function() {

			return window.cancelAnimationFrame ||
				   window.mozCancelAnimationFrame ||
				   window.webkitCancelAnimationFrame ||
				   window.msCancelAnimationFrame ||
				   window.clearTimeout;

		}

	});

	// Static class members

	RAFRenderer.DEFAULT_FRAME_RATE = (1000 / 60); // 60fps

	// Public properties

	RAFRenderer.prototype.exposeProperty("rendering");

	RAFRenderer.prototype.exposeProperty("stage", "_stage",
		Fizz.restrict.toInstanceType("_stage", "Fizz.Stage"));

	RAFRenderer.prototype.exposeProperty("framerate", "_framerate",
		Fizz.restrict.toRange("_framerate", [10, Infinity]));

	RAFRenderer.prototype.exposeProperty("actualFramerate");

	RAFRenderer.prototype.exposeProperty("actualFPS", function() {
		return (1000 / this._actualFramerate).toFixed(2);
	});

	RAFRenderer.prototype.exposeProperty("logFPS", "_logFPS",
		Fizz.restrict.toBoolean("_logFPS"));

	// Class export
	Fizz.RAFRenderer = RAFRenderer;

}());
{'fraction_non_alphanumeric': 0.13460635467209267, 'fraction_numerical': 0.007825950853028642, 'mean_word_length': 3.3380855397148674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1522159', 'n_tokens_mistral': 2522, 'n_tokens_neox': 1983, 'n_words': 382}