I suggest you an experimental approach, try
public static void main(String[] args) throws InterruptedException {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long start = System.currentTimeMillis();
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
Thread.sleep(1000);
System.out.println(i + "->"+ j);
}
}
double elapsed_seconds = (System.currentTimeMillis() - start) / 1000;
System.out.println("seconds " + elapsed_seconds);
}
with different input values, in order to find out the expected behaviour.