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

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

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

Time.elapsedSince介绍

[英]Calculates the amount of time that has elapsed since this Time value.
[中]计算此Time值之后经过的时间量。

代码示例

代码示例来源:origin: org.apache.wicket/wicket-util

/**
 * Calculates the amount of time elapsed since start time.
 * 
 * @param start
 *            the start <code>Time</code>
 * @return the elapsed period as a <code>Duration</code>
 * @throws IllegalStateException
 *             if start <code>Time</code> is in the future
 */
public static Duration elapsed(final Time start)
{
  return start.elapsedSince();
}

代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Calculates the amount of time elapsed since start time.
 * 
 * @param start
 *            the start <code>Time</code>
 * @return the elapsed period as a <code>Duration</code>
 * @throws IllegalStateException
 *             if start <code>Time</code> is in the future
 */
public static Duration elapsed(final Time start)
{
  return start.elapsedSince();
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Calculates the amount of time elapsed since start time.
 * 
 * @param start
 *            the start <code>Time</code>
 * @return the elapsed period as a <code>Duration</code>
 * @throws IllegalStateException
 *             if start <code>Time</code> is in the future
 */
public static Duration elapsed(final Time start)
{
  return start.elapsedSince();
}

代码示例来源:origin: apache/wicket

private static long remaining(Time start, Duration timeout)
{
  return Math.max(0, timeout.subtract(start.elapsedSince()).getMilliseconds());
}

代码示例来源:origin: org.apache.wicket/wicket-core

private static long remaining(Time start, Duration timeout)
{
  return Math.max(0, timeout.subtract(start.elapsedSince()).getMilliseconds());
}

代码示例来源:origin: org.wicketstuff/push

public static boolean isConnected(final Application application,
    final String id, final Duration timeout) {
  final Time time = TimerChannelBehavior
      .getLastPollEvent(application, id);
  boolean isConnected;
  if (time == null) {
    // the behavior has been cleaned
    return false;
  }
  isConnected = time.elapsedSince().compareTo(timeout) < 0;
  if (!isConnected) {
    // timeout expired, the page is probably not connected anymore
    // we clean the metadata to avoid memory leak
    TimerChannelBehavior.cleanMetadata(application, id);
  }
  return isConnected;
}

代码示例来源:origin: org.apache.wicket/wicket-core

while (!locked && start.elapsedSince().lessThan(timeout))
      "Thread '{}' failed to acquire lock to page with id '{}', attempted for {} out of allowed {}." +
          " The thread that holds the lock has name '{}'.",
      thread.getName(), pageId, start.elapsedSince(), timeout,
          previous.thread.getName());
    if (Application.exists())

代码示例来源:origin: apache/wicket

while (!locked && start.elapsedSince().lessThan(timeout))
      "Thread '{}' failed to acquire lock to page with id '{}', attempted for {} out of allowed {}." +
          " The thread that holds the lock has name '{}'.",
      thread.getName(), pageId, start.elapsedSince(), timeout,
          previous.thread.getName());
    if (Application.exists())

相关文章