com.github.dreamhead.moco.procedure.LatencyProcedure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.procedure;
import com.github.dreamhead.moco.MocoProcedure;
import com.github.dreamhead.moco.util.Idles;
import java.util.concurrent.TimeUnit;
public class LatencyProcedure implements MocoProcedure {
public static final int DEFAULT_LATENCY = 1000;
private final long duration;
private final TimeUnit unit;
public LatencyProcedure(final long duration, final TimeUnit unit) {
this.duration = duration;
this.unit = unit;
}
@Override
public void execute() {
Idles.idle(duration, unit);
}
}