## $Revision: 1.2 $

## run with octave lushCompare.m

function z = harmonic (n)
  z = 0.0;
  for i = 1:n
    z = z + 1/i;
  endfor
endfunction

## 3 loop iterations is more than enough; this is SLOW
numberOfLoops = 3;
cstart = time();
for i = 1:numberOfLoops
  printf("%f - %d\n", harmonic (1000000), i);
endfor
cend = time();

printf ("%f seconds.\n", (cend - cstart) / numberOfLoops)


     
