java计算接口调用时间

方法一:

LocalDateTime beginTime = LocalDateTime.now();

Long opetime = Duration.between(between,LocalDateTime.now()).toMillis();

方法二:

Long beginTime = new Date().getTime();

Long opetime =new Date().getTime()-beginTime;

posted @ 2019-11-19 10:15  浪子丶沙  阅读(6558)  评论(0编辑  收藏  举报