// Copyright (C) 2015 anduo // All rights reserved package com.anduo.filesync.util; import java.util.concurrent.TimeUnit; /** * ━━━━━━神兽出没━━━━━━ *    ┏┓   ┏┓ *   ┏┛┻━━━┛┻┓ *   ┃       ┃ *   ┃   ━   ┃ *   ┃ ┳┛ ┗┳ ┃ *   ┃       ┃ *   ┃   ┻   ┃ *   ┃       ┃ *   ┗━┓   ┏━┛ *     ┃   ┃神兽保佑, 永无BUG! *     ┃   ┃Code is far away from bug with the animal protecting *     ┃   ┗━━━┓ *     ┃       ┣┓ *     ┃       ┏┛ *     ┗┓┓┏━┳┓┏┛ *      ┃┫┫ ┃┫┫ *      ┗┻┛ ┗┻┛ * ━━━━━━感觉萌萌哒━━━━━━ * Summary: 线程工具类 * Author : anduo@qq.com * Version: 1.0 * Date : 15/7/4 * time : 02:56 */ public class Threads { /** * sleep等待,单位为毫秒,忽略InterruptedException. */ public static void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { // Ignore. return; } } /** * sleep等待,忽略InterruptedException. */ public static void sleep(long duration, TimeUnit unit) { try { Thread.sleep(unit.toMillis(duration)); } catch (InterruptedException e) { // Ignore. return; } } }