Last active
December 27, 2015 19:09
-
-
Save benwaffle/7375269 to your computer and use it in GitHub Desktop.
SleepSort for java 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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