at 26.02.2002 8:45 Uhr, Jason Je wrote:

> Is there any specific reason you saying that the former loop is much
> faster??? I'm just curious... :)

Hm... - from a logical point of view, the first loop uses a static count,
while the latter loop always has to check the value of i and we have to
increment manually...

Although my tests show something different ?:-o

So maybe I'm completely wrong with that!


on test
  ms = the milliseconds
  
  repeat with a = 1 to 10000
    repeat with i = 0 to 99
      repeat with j = 0 to 4
        
      end repeat
    end repeat
  end repeat
  
  put the milliseconds - ms
  
  put i & " / " & j & " / " & a
  
end


on test2
  
  ms = the milliseconds
  
  i = 0
  
  repeat with a = 1 to 10000
    repeat while i < 100
      j = 0
      repeat while j < 5
        j = j+1
      end repeat
      i = i+1
    end repeat  
  end repeat
  
  put the milliseconds - ms
  
  put i & " / " & j & " / " & a
  
end


-- Andy Fuchs
-- silent movie media
-- mailto:[EMAIL PROTECTED]
-- http://www.silent-movie-media.com

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to