org.mockito.internal.util.Timer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-all Show documentation
Show all versions of mockito-all Show documentation
Mock objects library for java
package org.mockito.internal.util;
public class Timer {
private final long durationMillis;
private long startTime = -1;
public Timer(long durationMillis) {
this.durationMillis = durationMillis;
}
/**
* Informs whether the timer is still counting down.
*/
public boolean isCounting() {
assert startTime != -1;
return System.currentTimeMillis() - startTime <= durationMillis;
}
/**
* Starts the timer count down.
*/
public void start() {
startTime = System.currentTimeMillis();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy