public static long currentNanos() {
        Instant currentTime = Instant.now();
        return TimeUnit.SECONDS.toNanos(currentTime.getEpochSecond()) + currentTime.getNano();
    }
Check if the loop in {@link StatsCollector#printAndCollectStats} should stop.

@param startNanos start time in nanoseconds
@param nowNanos   current time in nanoseconds
@return true if the loop should stop
tools/src/main/java/org/apache/kafka/tools/automq/perf/StatsCollector.java