Java ThreadLocalRandom randomDelay()

Here you can find the source of randomDelay()

Description

random Delay

License

Open Source License

Declaration

static public void randomDelay() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ThreadLocalRandom;

public class Main {
    private static final int MIN_DELAY_IN_MS = 750;
    private static final int MAX_DELAY_IN_MS = 1000;

    static public void randomDelay() {
        int delayInMS = ThreadLocalRandom.current().nextInt(MIN_DELAY_IN_MS, MAX_DELAY_IN_MS);
        try {/*from  www .  j a v  a 2s . co m*/
            Thread.sleep(delayInMS);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. randomAge()
  2. randomAlphabetic(int length)
  3. randomBoundedInclusiveInt(int start, int end)
  4. randomCase(String input)
  5. randomChar()
  6. randomDouble(final double min, final double max)
  7. randomElement(Collection c, int n, boolean unique)
  8. randomEnum(Class clazz)
  9. randomFishType()