com.topdesk.timetransformer.DefaultTime Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of time-transformer-agent Show documentation
Show all versions of time-transformer-agent Show documentation
Instrumentation agent to change System.currentTimeMillis() and System.nanoTime() for testing purposes
The newest version!
package com.topdesk.timetransformer;
import com.topdesk.timetransformer.agent.DoNotInstrument;
/**
* Default implementation of Time which redirects all calls to {@link System#currentTimeMillis} and {@link System#nanoTime}.
*
* Calls from this class to {@code System.currentTimeMillis} and {@code System.nanoTime} will not be redirected by the agent.
*/
@DoNotInstrument
public enum DefaultTime implements Time {
/**
* Singleton instance of DefaultTime
*/
INSTANCE;
@Override
public long currentTimeMillis() {
return System.currentTimeMillis();
}
@Override
public long nanoTime() {
return System.nanoTime();
}
@Override
public String toString() {
return super.toString() + ", DefaultTime";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy