Java Sleep sleep(int milliseconds, boolean isRecordMode)

Here you can find the source of sleep(int milliseconds, boolean isRecordMode)

Description

Wrapper on the Thread.sleep, in case of record mode will not sleep, otherwise sleep.

License

Open Source License

Parameter

Parameter Description
milliseconds time in milliseconds for which to sleep.

Declaration

public static void sleep(int milliseconds, boolean isRecordMode) 

Method Source Code

//package com.java2s;
/**//from w  ww  .  j  a  va 2 s .c o m
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 */

public class Main {
    /**
     * Wrapper on the Thread.sleep, in case of record mode will not sleep, otherwise sleep.
     * @param milliseconds time in milliseconds for which to sleep.
     */
    public static void sleep(int milliseconds, boolean isRecordMode) {
        if (isRecordMode) {
            try {
                Thread.sleep(milliseconds);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

Related

  1. sleep(int millis)
  2. sleep(int millis)
  3. sleep(int millis)
  4. sleep(int millis, int micros)
  5. sleep(int milliseconds)
  6. sleep(int minwait, int maxwait)
  7. sleep(int ms)
  8. sleep(int ms)
  9. sleep(int retryInterval)