function time(key, fn, stats) {
		return function (...args) {
			const t = startTime();
			const result = fn(...args);
			const tdiff = endTime(t);

			if (enabled) {
				if (typeof data[key] === "undefined") {
					data[key] = 0;
				}

				data[key] += tdiff;
			}

			return stats ? { result, tdiff } : result;
		};
	}
Time the run
@param {any} key key from the data object
@param {Function} fn function to be called
@param {boolean} stats if 'stats' is true, return the result and the time difference
@returns {Function} function to be executed
@private