Multithreading

Submitting actions to run in multiple threads

Runnable action = () -> {
    System.out.println("Hello! I'm in another thread!");
};

Multithreading.submit(action);

Scheduling an action to run after some time

Runnable action = () -> {
    System.out.println("Hello! I'm in another thread and was run after 5 seconds!");
};

Mulithreading.schedule(action, 5, TimeUnit.SECONDS);

Last updated