⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chrono.java

📁 基于Junit的 功能和单元测试的的测试工具。只支持Swing.
💻 JAVA
字号:
package org.uispec4j.utils;

import junit.framework.Assert;

import java.util.Date;

public class Chrono {
  private Date startDate;

  public static Chrono start() {
    return new Chrono();
  }

  private Chrono() {
    startDate = new Date();
  }

  public void assertElapsedTimeLessThan(long max) {
    long elapsed = getElapsedTime();
    Assert.assertTrue("Maximum elapsed time reached: " + elapsed + " >= " + max,
                      elapsed < max);
  }

  public long getElapsedTime() {
    Date currentDate = new Date();
    return currentDate.getTime() - startDate.getTime();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -