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

com.github.dreamhead.moco.procedure.LatencyProcedure Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy