code: function getLatency(emitter) {
      var start = Date.now();
  
      return emitter.request('time')
          .then(function (timestamp) {
            var end = Date.now();
            var latency = (end - start) / 2;
            var time = timestamp + latency;
  
            // apply the first ever retrieved offset immediately.
            if (isFirst) {
              isFirst = false;
              emitter.emit('change', time);
            }
  
            return latency;
          })
    }
docs: Request the time of the master and calculate the latency from the
  roundtrip time
  @param {{request: function}} emitter
  @returns {Promise.<number | null>} returns the latency
  @private