All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.topdesk.timetransformer.DefaultTime Maven / Gradle / Ivy

Go to download

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