docs: function getRes(unit) {
        var measured,
            begin,
            count = 30,
            divisor = 1e3,
            ns = timer.ns,
            sample = [];
  
        // get average smallest measurable time
        while (count--) {
          if (unit == 'us') {
            divisor = 1e6;
            if (ns.stop) {
              ns.start();
              while (!(measured = ns.microseconds())) { }
            } else if (perfName) {
              divisor = 1e3;
              measured = Function('n', 'var r,s=n.' + perfName + '();while(!(r=n.' + perfName + '()-s)){};return r')(ns);
            } else {
              begin = ns();
              while (!(measured = ns() - begin)) { }
            }
          }
          else if (unit == 'ns') {
            divisor = 1e9;
            begin = ns.nanoTime();
            while (!(measured = ns.nanoTime() - begin)) { }
          }
          else {
            begin = new ns;
            while (!(measured = new ns - begin)) { }
          }
          // check for broken timers (nanoTime may have issues)
          // http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/
          if (measured > 0) {
            sample.push(measured);
          } else {
            sample.push(Infinity);
            break;
          }
        }
        // convert to seconds
        return getMean(sample) / divisor;
      }