当前位置: 首页>>代码示例>>Java>>正文


Java CGlobal.MILLISECONDS_PER_SECOND属性代码示例

本文整理汇总了Java中com.helger.commons.CGlobal.MILLISECONDS_PER_SECOND属性的典型用法代码示例。如果您正苦于以下问题:Java CGlobal.MILLISECONDS_PER_SECOND属性的具体用法?Java CGlobal.MILLISECONDS_PER_SECOND怎么用?Java CGlobal.MILLISECONDS_PER_SECOND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.helger.commons.CGlobal的用法示例。


在下文中一共展示了CGlobal.MILLISECONDS_PER_SECOND属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _timedSearch

private static void _timedSearch (@Nonnull final IThrowingRunnable <IOException> aRunnable,
                                  @Nonnull final Query aQuery) throws IOException
{
  final StopWatch aSW = StopWatch.createdStarted ();
  try
  {
    aRunnable.run ();
  }
  finally
  {
    final long nMillis = aSW.stopAndGetMillis ();
    s_aStatsQueryTimer.addTime (aQuery.toString (), nMillis);
    if (nMillis > CGlobal.MILLISECONDS_PER_SECOND)
      s_aLogger.warn ("Lucene Query " + aQuery + " took too long: " + nMillis + "ms");
  }
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:16,代码来源:PDStorageManager.java

示例2: getUnifiedMillis

/**
 * Get milliseconds suitable for HTTP requests/responses. Rounds down to the
 * nearest second for a proper compare. Java has milliseconds, HTTP
 * requests/responses have not.
 *
 * @param nMillis
 *        Milliseconds to use
 * @return The rounded milliseconds
 */
public static long getUnifiedMillis (final long nMillis)
{
  return nMillis / CGlobal.MILLISECONDS_PER_SECOND * CGlobal.MILLISECONDS_PER_SECOND;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:13,代码来源:CHttp.java


注:本文中的com.helger.commons.CGlobal.MILLISECONDS_PER_SECOND属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。