I am researching some things for an upcoming project at work, and I've been commissioned to find a way to keep track of how long code takes to execute. Why? The first example I showed to the person heading the project took forever to load because of his input. It's a form (I'm showing him that I can use the CGI module) that inputs a string in a text field, and then ravages it with regular expressions and random characters to make, basically, a big mess that's pretty. If you input a string without spaces (as he did), it takes longer to execute. I want to meter how long it takes and (I guess) output the run time.
So yeah, if anyone can tell me how to benchmark a script without using any modules (not counting CGI), please do. I've looked around and can't really find a good way to do it. To be honest, I don't even really have an idea...
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.