Created
May 20, 2011 07:45
-
-
Save xuwei-k/982512 to your computer and use it in GitHub Desktop.
Scala Sleep Sort
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
Seq( 5, 3, 6, 3, 6, 3, 1, 4, 7 ).map{ i => | |
() => concurrent.ops.spawn{ | |
Thread.sleep(i * 100) | |
print(i+",") | |
} | |
}.foreach(_.apply) | |
//1,3,3,3,4,5,6,6,7, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment