package nl.tudelft.simulation.dsol; /** * Sleep implements a sleep without an InterruptedException. *
* Copyright (c) 2021-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information DSOL Manual. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * DSOL License. *
* @author Alexander Verbraeck */ public final class Sleep { /** * Utility class. */ private Sleep() { // Utility class } /** * Sleep millis milliseconds. * @param millis long; the number of milliseconds to sleep */ public static void sleep(final long millis) { try { Thread.sleep(millis); } catch (InterruptedException exception) { // ignore } } /** * Sleep millis + nanos time. * @param millis long; the number of milliseconds to sleep * @param nanos int; the number of nanoseconds to sleep */ public static void sleep(final long millis, final int nanos) { try { Thread.sleep(millis, nanos); } catch (InterruptedException exception) { // ignore } } }