Tabnine Logo
Wait.randomMillis
Code IndexAdd Tabnine to your IDE (free)

How to use
randomMillis
method
in
sirius.kernel.commons.Wait

Best Java code snippets using sirius.kernel.commons.Wait.randomMillis (Showing top 2 results out of 315)

origin: com.scireum/sirius-kernel

  /**
   * Waits for a random amount of seconds within the given bounds.
   * <p>
   * See {@link #randomMillis(int, int)} for a detailed description on using a negative lower bound.
   *
   * @param minWaitSeconds the minimal time to wait in seconds.
   * @param maxWaitSeconds the maximal time to wait in seconds. This must be &gt;= minWaitSeconds and also &gt; 0
   *                       or the
   *                       method will always return immediately
   */
  public static void randomSeconds(double minWaitSeconds, double maxWaitSeconds) {
    randomMillis((int) Math.round(1000 * minWaitSeconds), (int) Math.round(1000 * maxWaitSeconds));
  }
}
origin: com.scireum/sirius-search

  Wait.randomMillis(-500, 500);
} catch (HandledException e) {
  throw e;
sirius.kernel.commonsWaitrandomMillis

Javadoc

Waits for an random amount of millisecond within the given bounds.

Note that minWaitMillis may be negative. This can be used to only block the thread in a given percentage of all calls. So if the thread should wait between 0 and 500ms in 50% of all calls randomMillis(-500, 500) can be invoked. Using this bounds, the expected wait time will be between -500ms and 0ms in 50% of all calls (on average). As negative delays are ignored, the method will return immediately.

Popular methods of Wait

  • millis
    Waits the given amount of milliseconds. If the given value is 0 or negative, the method returns imme
  • seconds
    Waits the given amount of seconds. If the given value is 0 or negative, the method returns immediate

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • Kernel (java.awt.image)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Reference (javax.naming)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now