Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] array1 = new int[1000000], array2 = new int[1000000];
- long start = System.nanoTime();
- for (int i = 1; i < 100000; i++) {
- System.arraycopy(array2, 0, array1, 0, 1000000);
- }
- System.out.println(System.nanoTime() - start);
- start = System.nanoTime();
- for (int i = 1; i < 100000; i++) {
- for (int j = 0; j < 1000000; j++)
- array1[j] = 0;
- }
- System.out.println(System.nanoTime() - start);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement