Last active
September 13, 2016 15:48
-
-
Save kewang/e7e066818ab96590952fcfc11f788399 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Random; | |
public class Main { | |
public static void main(String[] args) { | |
long start = System.currentTimeMillis(); | |
Random r = new Random(); | |
for (int i = 0; i < 1000; i++) { | |
for (int j = 0; j < 1000; j++) { | |
if (r.nextInt(4) == 0) { | |
System.out.print("O"); | |
} else { | |
System.out.print("#"); | |
} | |
} | |
System.out.println(""); | |
} | |
System.out.println(System.currentTimeMillis() - start + "ms"); | |
} | |
} |
Author
kewang
commented
Sep 13, 2016
- https://stackoverflow.com/questions/21947452/why-is-printing-b-dramatically-slower-than-printing
- https://blog.gslin.org/archives/2016/09/13/6837/
- https://www.facebook.com/kewang.information/posts/1776794122596954
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment