Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] arr = new int[10000000]
- for (int i = 0; i < 10000000; i++) {
- arr[i] = i
- }
- def t0 = System.currentTimeMillis()
- long sum = 0
- for (int i = 0; i < 10000000; i++) {
- sum += arr[i]
- }
- def t1 = System.currentTimeMillis()
- printf("The call took %dms to run. Sum is %d\n", (t1 - t0), sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement