add groupTimeInterval

This commit is contained in:
Looly
2020-11-28 23:29:10 +08:00
parent a09861b033
commit a302a11483
9 changed files with 282 additions and 35 deletions

View File

@@ -0,0 +1,20 @@
package cn.hutool.core.date;
import cn.hutool.core.lang.Console;
import cn.hutool.core.thread.ThreadUtil;
import org.junit.Test;
public class TimeIntervalTest {
@Test
public void intervalGroupTest(){
final TimeInterval timer = new TimeInterval();
timer.start("1");
ThreadUtil.sleep(800);
timer.start("2");
ThreadUtil.sleep(900);
Console.log("Timer 1 took {} ms", timer.intervalMs("1"));
Console.log("Timer 2 took {} ms", timer.intervalMs("2"));
}
}