关于java:计算间隔时间

36次阅读

共计 168 个字符,预计需要花费 1 分钟才能阅读完成。

Instant before = Instant.now();

/*
do something
*/

Instant after = Instant.now();
Duration duration = Duration.between(start, end);
System.out.println("time =" + duration.toMillis() + "ms");

正文完
 0