com.google.gwt.core.client.Duration.elapsedMillis()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(118)

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

Duration.elapsedMillis介绍

[英]Returns the number of milliseconds that have elapsed since this object was created.
[中]返回自创建此对象以来经过的毫秒数。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

/** Returns the time (mm:ss) that have elapsed since this timer was created. */
private String getElapsedTime() {
 final int elapsedSec = duration.elapsedMillis() / 1000;
 final int minutesPart = elapsedSec / 60;
 final int secondsPart = elapsedSec - minutesPart * 60;
 return (minutesPart < 10 ? "0" + minutesPart : minutesPart)
   + ":"
   + (secondsPart < 10 ? "0" + secondsPart : secondsPart);
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

private boolean delayConditionMet() {
 if (mouseUpDuration == null) {
  return false;
 }
 return options.getDelay() <= mouseUpDuration.elapsedMillis();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

while (duration.elapsedMillis() < TIME_SLICE) {
 boolean executedSomeTask = false;
 for (int i = 0; i < length; i++) {

代码示例来源:origin: com.google.gwt/gwt-servlet

int cumulativeElapsedMillis = duration.elapsedMillis();
state.setElapsedMillis(cumulativeElapsedMillis - lastElapsedMillis);
lastElapsedMillis = cumulativeElapsedMillis;

代码示例来源:origin: apache/incubator-wave

void add(String name) {
 events.put(name, duration.elapsedMillis());
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
  * Iterate over all animations and update them.
  */
 private void updateAnimations() {
  // Copy the animation requests to avoid concurrent modifications.
  AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];
  curAnimations = animationRequests.toArray(curAnimations);

  // Iterate over the animation requests.
  Duration duration = new Duration();
  for (AnimationHandleImpl requestId : curAnimations) {
   // Remove the current request.
   animationRequests.remove(requestId);

   // Execute the callback.
   requestId.getCallback().execute(duration.getStartMillis());
  }

  // Reschedule the timer if there are more animation requests.
  if (animationRequests.size() > 0) {
   /*
    * In order to achieve as close to 60fps as possible, we calculate the new
    * delay based on the execution time of this method. The delay will be
    * less than 16ms, assuming this method takes more than 1ms to complete.
    */
   timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));
  }
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

while (duration.elapsedMillis() < TIME_SLICE) {
 boolean executedSomeTask = false;
 for (int i = 0; i < length; i++) {

代码示例来源:origin: com.google.web.bindery/requestfactory-server

while (duration.elapsedMillis() < TIME_SLICE) {
 boolean executedSomeTask = false;
 for (int i = 0; i < length; i++) {

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

while (duration.elapsedMillis() < TIME_SLICE) {
 boolean executedSomeTask = false;
 for (int i = 0; i < length; i++) {

代码示例来源:origin: net.wetheinter/gwt-user

int cumulativeElapsedMillis = duration.elapsedMillis();
state.setElapsedMillis(cumulativeElapsedMillis - lastElapsedMillis);
lastElapsedMillis = cumulativeElapsedMillis;

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

int cumulativeElapsedMillis = duration.elapsedMillis();
state.setElapsedMillis(cumulativeElapsedMillis - lastElapsedMillis);
lastElapsedMillis = cumulativeElapsedMillis;

相关文章