Guest User

Untitled

a guest
Jan 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public class TestingClass {
  2.  
  3. public static void main(String[] args) {
  4. int s=10000;
  5. int[] pixels=new int[s*s];
  6. int[][] pixels2=new int[s][s];
  7. long now=System.currentTimeMillis();
  8. for(int i=0; i<s*s; ++i) {
  9. pixels[i]=-1;
  10. }
  11. System.out.println(System.currentTimeMillis()-now);
  12. now=System.currentTimeMillis();
  13. for(int i=0; i<s; ++i) {
  14. for (int j = 0; j <s; j++) {
  15. pixels2[j][i]=-1;
  16. }
  17. }
  18. System.out.println(System.currentTimeMillis()-now);
  19. }
  20. }
Add Comment
Please, Sign In to add comment