'use strict';

var isCallable = require('es5-ext/lib/Object/is-callable')

  , name, now, round, dateNow;

if ((typeof performance !== 'undefined') && performance) {
	if (isCallable(performance.now)) {
		name = 'now';
	} else if (isCallable(performance.mozNow)) {
		name = 'mozNow';
	} else if (isCallable(performance.msNow)) {
		name = 'msNow';
	} else if (isCallable(performance.oNow)) {
		name = 'oNow';
	} else if (isCallable(performance.webkitNow)) {
		name = 'webkitNow';
	}

	if (name) {
		round = Math.round;
		dateNow = Date.now;
		now = function () {
			return round((now() + performance[name]() % 1) * 1000);
		};
	}
}

if (!now && (typeof process !== 'undefined') && process &&
		(process.title === 'node')) {
	try { now = (require)('microtime').now; } catch (e) {}
}

if (!now) {
	dateNow = Date.now;
	now = function () { return dateNow() * 1000; };
}

module.exports = now;

'use strict';

var isCallable = require('es5-ext/lib/Object/is-callable')

  , name, now, round, dateNow;

if ((typeof performance !== 'undefined') && performance) {
	if (isCallable(performance.now)) {
		name = 'now';
	} else if (isCallable(performance.mozNow)) {
		name = 'mozNow';
	} else if (isCallable(performance.msNow)) {
		name = 'msNow';
	} else if (isCallable(performance.oNow)) {
		name = 'oNow';
	} else if (isCallable(performance.webkitNow)) {
		name = 'webkitNow';
	}

	if (name) {
		round = Math.round;
		dateNow = Date.now;
		now = function () {
			return round((dateNow() + performance[name]() % 1) * 1000);
		};
	}
}

if (!now && (typeof process !== 'undefined') && process &&
		(process.title === 'node')) {
	try { now = (require)('microtime').now; } catch (e) {}
}

if (!now) {
	dateNow = Date.now;
	now = function () { return dateNow() * 1000; };
}

module.exports = now;

Fix var reference (caused infinite loop)
Fix var reference (caused infinite loop)
