美文网首页
java延时

java延时

作者: 在暗处凝视世间喧华繁闹 | 来源:发表于2019-12-21 17:41 被阅读0次

```

1.Thread.currentThread().sleep(8000);//毫秒

2.long start1 = System.currentTimeMillis();

logger.info("updateShop时间:"+start1);

try {

    TimeUnit.SECONDS.sleep(10);

} catch (InterruptedException e) {

    e.printStackTrace();

}

long start2 = System.currentTimeMillis();

logger.info("updateShop时间:"+(start2-start1));

```

相关文章

网友评论

      本文标题:java延时

      本文链接:https://www.haomeiwen.com/subject/kexcgctx.html