All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.spun.util.ThreadUtils Maven / Gradle / Ivy

There is a newer version: 24.9.0
Show newest version
package com.spun.util;

import org.lambda.actions.Action0;

import java.time.Duration;

public class ThreadUtils
{
  public static void sleep(long millis)
  {
    try
    {
      Thread.sleep(millis);
    }
    catch (Exception e)
    {
      // ignore
    }
  }
  public static void launch(Action0 action)
  {
    launch(action, Duration.ZERO);
  }
  public static void launch(Action0 action, Duration delay)
  {
    new LambdaThreadLauncher(action, delay);
  }
  public static StackTraceElement[] getStackTrace()
  {
    return Thread.currentThread().getStackTrace();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy