
var Bench = new Class({
	unit: function(second) {
		return (second > 1000) ? second = (second / 1000) + 's' : second + 'ms';	
	},
	start: function() {
		this.itime = new Date();
	},
	stop: function(message) {
		this.stime = new Date();
		
		console.log(
			"%sduration: %s", 
			(message) ? 'message: ' + message + ', ' : '', 
			this.unit(this.stime - this.itime)
		);
	}
});	
	
if (Browser.Engine.presto)
	var console = {log: opera.postError};

$try(function() {
	loadFirebugConsole();
});

var bench = new Bench();
