I have a question about how to benchmark code.

The Background Info:
I have recently created a weblog analyser for my high school. As a feature for it, I have created a "hierarchy view" so the webmaster can easily browse his way through the site, finding the amount of hits a certain directory/file/etc has gotten. You can see it here. Click on a side caret (or as some like to call it, a "greater than symbol") link at the end of a line to expand a directory, or click the plus sign to add to a watched link (don't do that, or if you do delete it. Its only for the webmaster).

The Question:
Sometimes, this "hierarchy view" runs kinda slow. It seems to run slower for larger directories; however, that doesn't make any sense since the script still has to sort through the same amount of data for a smaller directory. I would like to know where my script is hanging up so I can possibly fix it, or find out if it is just the browser taking awhile to show the information. Is there any way to do this?

Thanks!

In reply to Question about benchmarking by jryan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.