SAXProcessor.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:SAX 作者:
/**
 * Generic method to convert the milliseconds into the elapsed time string.
 * 
 * @param start Start timestamp.
 * @param finish End timestamp.
 * @return String representation of the elapsed time.
 */
public static String timeToString(long start, long finish) {

  Duration duration = new Duration(finish - start); // in milliseconds
  PeriodFormatter formatter = new PeriodFormatterBuilder().appendDays().appendSuffix("d")
      .appendHours().appendSuffix("h").appendMinutes().appendSuffix("m").appendSeconds()
      .appendSuffix("s").appendMillis().appendSuffix("ms").toFormatter();

  return formatter.print(duration.toPeriod());

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号