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

com.github.siwenyan.si.SiCommandExecutorPause Maven / Gradle / Ivy

There is a newer version: 1.25.1.0
Show newest version
package com.github.siwenyan.si;

class SiCommandExecutorPause extends SiCommandExecutor {

    private double pauseFactor = 1.0;

    public void setPauseFactor(double pauseFactor) {
        this.pauseFactor = pauseFactor;
    }

    @Override
    public void execute(SiCommand command, SiContext siContext) throws SiVerifyException {

        String target = command.getSiModelCommand().getTarget();
        long timeOutInMilliseconds = Long.parseLong(target);
        try {
            Thread.sleep(new Double(timeOutInMilliseconds * this.pauseFactor).longValue());
        } catch (InterruptedException e) {
            //do nothing
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy