0 Replies Latest reply on Oct 17, 2007 6:47 AM by obouillaud

    High resolution timer

    obouillaud Level 1
      Hi

      I'm currently trying to spy a slow part of my code and I face a problem : the GetTickCount() function does not seem to be precise enough to tell me where is the slowest part of the code.

      As there is many things linked, I can't just remove a part of the code and see if it's still slow... If I do so, the code does not run...

      What I did for the moment is to make a gettickcount() between each important line of code and at the end make a table with the durations of each function.
      The problem is that I face a strange behavior : I have increments of 16ms (sometimes 15 ou 31) but not very regulary and it does not seems to be related to a specific function. Let me explain.
      I make a 100 times loop with let's say 30 different "functions" (an object creation, some cfset, ...) inside each loop.

      In the first loop, after the 2nd function call, already 16ms has passed, then nothing for the 20 other function calls, then 16ms more... then the 2nd loop starts, and after the 2nd function call, no more "ms" has passed... and after the 15th function cal, suddenly 16 more ms has passed. (sorry if it's not clear)... here is an image of my debugging table : http://img502.imageshack.us/img502/8482/iterationsph7.gif

      So there is no regularity and I can't find where the slow part is.

      Is there a way to have a more precise timer ? or another solution to find why this loop is so slow.