Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestingClass {
- public static void main(String[] args) {
- int s=10000;
- int[] pixels=new int[s*s];
- int[][] pixels2=new int[s][s];
- long now=System.currentTimeMillis();
- for(int i=0; i<s*s; ++i) {
- pixels[i]=-1;
- }
- System.out.println(System.currentTimeMillis()-now);
- now=System.currentTimeMillis();
- for(int i=0; i<s; ++i) {
- for (int j = 0; j <s; j++) {
- pixels2[j][i]=-1;
- }
- }
- System.out.println(System.currentTimeMillis()-now);
- }
- }
Add Comment
Please, Sign In to add comment