public void logWithRunnable(Runnable runnable) {
        long currentTimeMillis = System.currentTimeMillis();
        if (disabled) {
            runnable.run();
        } else if (currentTimeMillis > lastLogTime + waitTime) {
            lastLogTime = currentTimeMillis;
            runnable.run();
        }

    }
@Test
    public void testDisable() throws InterruptedException {
        System.setProperty(RpcOptions.DISABLE_LOG_TIME_WAIT_CONF,"true");
        try{
            TimeWaitLogger timeWaitLogger = new TimeWaitLogger(100);
            AtomicLong atomicLong = new AtomicLong();
            new Thread(()->{
                while (true){
                    timeWaitLogger.logWithRunnable(atomicLong::incrementAndGet);
                }
            }).start();
            Thread.sleep(150);
            Assert.assertTrue(atomicLong.get()>1000);
        }finally {
            System.setProperty(RpcOptions.DISABLE_LOG_TIME_WAIT_CONF,"");
        }

        TimeWaitLogger timeWaitLogger = new TimeWaitLogger(100);
        AtomicLong atomicLong = new AtomicLong();
        new Thread(()->{
            while (true){
                timeWaitLogger.logWithRunnable(atomicLong::incrementAndGet);
            }
        }).start();
        Thread.sleep(150);
        Assert.assertEquals(2L,atomicLong.get());

    }