// Generated by CoffeeScript 1.12.7
(function() {
  var hrtime, mozNow, msNow, now, oNow, perf, perfNow, polyNow, webkitNow;

  perf = global.performance || {};

  now = perf.now, mozNow = perf.mozNow, msNow = perf.msNow, oNow = perf.oNow, webkitNow = perf.webkitNow;

  polyNow = function() {
    return (new Date()).getTime();
  };

  perfNow = now || mozNow || msNow || oNow || webkitNow || polyNow;

  hrtime = function(prevTime) {
    var clockTime, ns, seconds;
    clockTime = perfNow.call(perf) * 1e-3;
    seconds = Math.floor(clockTime);
    ns = Math.floor((clockTime % 1) * 1e9);
    if (prevTime) {
      seconds = seconds - prevTime[0];
      ns = ns - prevTime[1];
      if (ns < 0) {
        seconds--;
        ns += 1e9;
      }
    }
    return [seconds, ns];
  };

  module.exports = process.hrtime || hrtime;

}).call(this);
