in reply to Can the html output format of Devel::NYTProf be changed?

I think that these few lines (from sub get_html_header() in file: Devel-NYTProf-4.06/bin/nytprofhtml may be where the change would need to be applied. I can't be sure because I believe the code in question is javascript, and I've done very little of that and what I did do, was a long time since:

format: function(orig) { // format data for normalization // console.log(orig); val = orig.replace(/ns/,''); if (val != orig) { return val / (1000*1000*1000); } val = orig.replace(/µs/,''); /* XXX use &micro; ? */ if (val != orig) { return val / (1000*1000); } var val = orig.replace(/ms/,''); if (val != orig) { return val / (1000); } var val = orig.replace(/s/,''); ######## <<<<<<<<<<<<<< if (val != orig) { return val; } if (orig == '0') { return orig; } console.log('no match for fmt_time of '.concat(orig)); return orig; },

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: Can the html output format of Devel::NYTProf be changed?
by flexvault (Monsignor) on Mar 31, 2012 at 09:32 UTC

    BrowserUk,

    I did look at that javascript code in the html output, but it didn't seem to be called. But because you mentioned 'nytprofhtml', I looked at the code expecting it to be compiled like NYTProf.so, but it was a pure Perl script.

    In the script they did a 'use Devel::NYTProf::Util' which had a sub 'fmt_time'. It had a series of 'sprintf's and I made the change there. Now the output has 'Sec' instead of 's'. While I was at it, I added some bold to the lines to make it a little easier on my eyes.

    Devel::NYTProf is awesome!

    Thank you

    "Well done is better than well said." - Benjamin Franklin