public class withloop {
public static void main(String [] args) {
long start = System.currentTimeMillis();
int a [] = new int [5];
for (int i=0; i < a.length; i++) {
a[i] = i + 1;
}
for (int j = 0; j < a.length; j++) {
System.out.print(a[j] + " ");
}
long end = System.currentTimeMillis();
System.out.println(end - start);
}
The is a simple code from my exercise to generate the runtime. After running it a few times, the runtime was suppose to change however, it did not and it stays the same no matter how many times I run it again. The output of the runtime is 0 millisecond.