Java Thread Pause pause(double seconds)

Here you can find the source of pause(double seconds)

Description

pause

License

Open Source License

Declaration

public static void pause(double seconds) 

Method Source Code

//package com.java2s;
/**************************************************************************************
*  Copyright (c) 2013, Universitat Politecnica de Valencia. All rights reserved.      *
*  This program and the accompanying materials are made available under the terms     *
*  of the 3-Clause BSD License which accompanies this distribution, and is available  *
*  at http://www.opensource.org/licenses/BSD-3-Clause. The research leading to these  *
*  results has received funding from the European Community`s Seventh Framework       *
*  Programme (FP7/2007-2013) under the grant agreement  FP7-257574 FITTEST.           *
**************************************************************************************/

public class Main {
    public static void pause(double seconds) {
        if (seconds <= 0)
            return;

        try {//from   www .  j  a va2  s .com
            Thread.sleep(Math.round(seconds * 1000.0));
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. pause (final int msec)
  2. pause()
  3. pause(double seconds)
  4. pause(double timeInSec)
  5. pause(final long time)
  6. pause(int i, String unit)