Skip to main content
Participating Frequently
June 2, 2008
Question

Looping over a Query

  • June 2, 2008
  • 2 replies
  • 438 views
Can u tell me if there is any performance difference in looping over Query result using cfloop and cfoutput ?
    This topic has been closed for replies.

    2 replies

    Participating Frequently
    June 3, 2008
    i tried this exapmple
    but my query has only 100 records. and the execution time is shown as 16 using the get tickcount.
    It shows no difference at present. But when the records increases what will be the case ?
    Inspiring
    June 2, 2008
    To find out for yourself do something like this:

    1. run your query.
    2. set a start time variable using gettickcount().
    3. set up a loop from 1 to a million.
    4. run through the query using cfoutput.
    5. after the closing cfloop tag, set a stop time variable using gettickcount.

    repeat steps 2 to 5, but using cfloop in step 4.