[fpc-pascal] for loop vs while loop

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Feb 1 13:12:48 CET 2017


On Wed, 1 Feb 2017 11:49:34 +0000
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

> Hi,
> 
> Just curious (been in a discussion with somebody else). Is there a
> performance difference between a FOR loop and a WHILE loop?

Yes, for-loop calculates the end value only once.

 
> Not sure if it will make a difference, but the usage is with three
> nested loops, iterating over some 300,000 plus data points in total.

Mattias


More information about the fpc-pascal mailing list