Skip to content

Instantly share code, notes, and snippets.

@kellyfj
Created September 29, 2016 16:31
Show Gist options
  • Save kellyfj/cc915cefea08e95d64de338fe85e3976 to your computer and use it in GitHub Desktop.
Save kellyfj/cc915cefea08e95d64de338fe85e3976 to your computer and use it in GitHub Desktop.
Parallelizing a fixed number range of long running actions
//Parallelizing a fixed number range of long running actions
IntStream.range(0, NUM_OBJECTS_TO_CREATE).parallel().forEach(i -> {
//Your long running stuff goes here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment