I have a test plan that does a sequence of steps, building on each other. I call the file with Test::Harness. I wrap each step in an "ok" statement, and I can get a nice statement at the end about the total time used in the process. That's very nice. I don't see a way to get it to tell me how many milliseconds each individual test took, though.

Technically, I don't really care about the absolute numbers. I actually want to know whether speeding up step N in various ways will slow down step N+1. I'm sure other clever things would come to mind if I could get it working, but I had in mind something that would process the output from my Test::Harness run and come up with some sort of statement about where my bottlenecks are, etc. So I'd like the output to be something like

ok 1 - 100 ms - the first test ok 2 - 85 ms - test #2 ok 3 - 25 ms - done now 1..3 ok 210 ms Result: PASS
and I'd look at that and do something with it.

As it stands now, I get most of this information but can't get the intermediate "ok" statements to tell me their timing. I wonder if there's a different tool I should look at or if I can just teach Test::Harness to do its output differently. I understand it would work fine if I used separate test files for each little piece, but then I don't see how to pass the results from one to the next.

Thanks for your help,

dave


In reply to Getting timing details from a test by mcdave

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.