program Time;
uses BaseUnix, Unix;
   var
      start, finish, res: int64;
      n, i, j: Integer;
      g: Array of Array of Integer;
      t: Cardinal;
function GetTickCount: Cardinal; stdcall;
var
  t: timeval;
begin
  fpgettimeofday(@t, nil);
  GetTickCount := t.tv_sec * 1000 + t.tv_usec div 1000;
end;
begin
   n := 8000;
   SetLength(g, n, n);
   t := GetTickCount;
   for i:=1 to n-1 do
      for j:=1 to n-1 do
         g[i,j] := 1;
   writeln('Time by rows:', GetTickCount - t, ' tics' );
   t := GetTickCount;
   for i:=1 to n-1 do
      for j:=1 to n - 1 do
         g[j,i] := 1;
   writeln('Time by cols:', GetTickCount - t, ' tics' );
end.