Question: Measuring execution time

The simple test procedure P constructs a large matrix.
Measuring the real time twice  (t1 and t2), t2 was by about 25% larger!
Now, if we remove the comment  before "Start",  t1 increases by 25% and t2 ~ t1.
So, the timing depends on whether some output is already on screen (standard interface).
Can you explain this?

restart;
P := proc(n,A)
  local i, j;
  for i from 1 to n do  for j from 1 to n do
    A[i,j]:=sin(arcsin(1/i-1/j+1/n))-1/i+1/j-1/n+i+j
  od od;
  NULL  #A;
end proc:

# "Start";
n := 300:
s := time[real]():
A:=Matrix(n,datatype=float[8]):
P(n,A):
t1:=time[real]()-s;

s := time[real]():
A:=Matrix(n,datatype=float[8]):
P(n,A):
t2:=time[real]()-s;
t2/t1;  # 1.24   WHY?

(For one of my programs, I found t2/t1 = 1.7)

Please Wait...