private long tillNextMillis(final long lastTimestamp) {
        long timestamp = System.nanoTime();
        while (timestamp <= lastTimestamp) {
            timestamp = System.nanoTime();
        }
        return timestamp;
    }
reference :https://github.com/twitter/snowflake/blob/master/src/main/scala/com/twitter/service/snowflake/IdWorker.scala
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/utils/IdWorker.java