Commit 86aaa505 by huangfusuper

【插件测试】脚本执行插件测试

parent 58742675
package com.byit.util;
import java.util.concurrent.TimeUnit;
/**
* 对于时间的格式化
* @author huangfu
*/
public class TimeFormatUtil {
/**
* 格式化毫秒数 返回对应的时间单位
* @param time
* @return
*/
public static String timeFormat(long time) {
//秒
long seconds = TimeUnit.MILLISECONDS.toSeconds(time);
long minutes = TimeUnit.MILLISECONDS.toMinutes(time);
long hours = TimeUnit.MILLISECONDS.toHours(time);
//小时
if(hours > 0){
return hours + "小时";
//分钟
} if (minutes > 0) {
return minutes + "分钟";
//秒
} else if (seconds > 0) {
return seconds + "秒";
//毫秒
} else{
return time+"毫秒";
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment