code: public synchronized long getBytesPerSecondAndFlush() {
          final long interval = nowMillis() - timestamp;
          if (interval < 1000 && bytesPerSecond != 0) return bytesPerSecond;
  
          // the first time we using 500 milliseconds to let speed valid more quick
          if (bytesPerSecond == 0 && interval < 500) return 0;
  
          return getInstantBytesPerSecondAndFlush();
      }
docs: Get bytes per-second and only if duration is greater than or equal to 1 second will flush and
  re-calculate speed.