// --- class performance ---

window.performance = window.performance || {};
performance.now = (function() {
  return performance.now       ||
         performance.mozNow    ||
         performance.msNow     ||
         performance.oNow      ||
         performance.webkitNow ||
         function() {return new Date().getTime();};
})();

function classPerf()
{
var root = this;
this.time_start = null;
this.now = function()
	{
	return performance.now();
	};
this.getTime = function()
	{
	var a,b,diff;
	a = root.time_start;
	b = root.now();
	root.time_start = b;
	diff = a!=null ? b - a : 0;
	diff = Math.floor(diff * 1000) / 1000;
	return diff;
	};
this.time_start = this.now();
}

PERF = new classPerf();
