org.apache.brooklyn.util.time.Time.makeTimeStringNanoRounded()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中org.apache.brooklyn.util.time.Time.makeTimeStringNanoRounded()方法的一些代码示例,展示了Time.makeTimeStringNanoRounded()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Time.makeTimeStringNanoRounded()方法的具体详情如下:
包路径:org.apache.brooklyn.util.time.Time
类名称:Time
方法名:makeTimeStringNanoRounded

Time.makeTimeStringNanoRounded介绍

暂无

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

/** @see #makeTimeString(long, boolean) */
public static String makeTimeStringRounded(long t, TimeUnit unit) {
  long nanos = unit.toNanos(t);
  return makeTimeStringNanoRounded(nanos);
}
/**

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

/**
 * A nice string representation of the duration; or null if null is passed in.
 * @see #makeTimeString(long, boolean)
 */
public static String makeTimeStringRounded(@Nullable Duration d) {
  return (d == null) ? null : makeTimeStringNanoRounded(d.toNanoseconds());
}
/** given an elapsed time, makes it readable, eg 44d 6h, or 8s 923ms, optionally rounding */

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

private void checkRN(long nanos, String expected) {
  Assert.assertEquals(Time.makeTimeStringNanoRounded(nanos), expected);
}

相关文章