Java Sleep for Second sleepSecond(double second)

Here you can find the source of sleepSecond(double second)

Description

sleep Second

License

Open Source License

Declaration

public static void sleepSecond(double second) 

Method Source Code

//package com.java2s;
/**/*from   w ww . j ava2  s .c  o m*/
 * Project: napoli.client
 * 
 * File Created at Aug 12, 2009
 * $Id: NapoliTestUtil.java 150227 2012-02-29 09:22:16Z yanny.wangyy $
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */

public class Main {
    public static void sleepSecond(double second) {
        try {
            Thread.sleep((int) (1000 * second));
        } catch (InterruptedException e) {
        }
    }

    public static void sleep(int milSecond) {
        try {
            Thread.sleep(milSecond);
        } catch (InterruptedException e) {
        }
    }
}

Related

  1. pauseSeconds(long pauseSeconds)
  2. sleepForSeconds(long seconds)
  3. sleepSeconds(double secs)
  4. sleepSeconds(long seconds)
  5. sleepSeconds(long seconds)
  6. sleepThreadForOneToSuppliedSecond(Thread t, int seconds)