Skip to content

Instantly share code, notes, and snippets.

@benwaffle
Last active December 27, 2015 19:09
Show Gist options
  • Select an option

  • Save benwaffle/7375269 to your computer and use it in GitHub Desktop.

Select an option

Save benwaffle/7375269 to your computer and use it in GitHub Desktop.
SleepSort for java 8
public class SleepSort {
public static void main(String[] args) {
for (String arg : args) {
int time = Integer.parseInt(arg);
new Thread(() -> {
try {
Thread.sleep(time*10);
} catch (Exception e) {e.printStackTrace();}
System.out.println(time);
}).start();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment