Skip to content

Instantly share code, notes, and snippets.

@chermehdi
Created July 4, 2018 13:30
Show Gist options
  • Save chermehdi/5b22da59e19c4df605f52c1d2f5b40bd to your computer and use it in GitHub Desktop.
Save chermehdi/5b22da59e19c4df605f52c1d2f5b40bd to your computer and use it in GitHub Desktop.
IntStream.range(0, 10).parallel().forEach(e -> {
try {
Thread.sleep(300);
System.out.println("the current working thred " + Thread.currentThread().getName());
} catch (InterruptedException ex) {
ex.printStackTrace();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment