This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Romuald
Recipients Romuald
Date 2015-04-30.16:27:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430411271.93.0.999844602202.issue24084@psf.upfronthosting.co.za>
In-reply-to
Content
When running pstats with functions that take less than 0.5 millisecond (per call for example), the value shown is '0.000, which isn't really helpful.

This patch aims to show the value in microseconds instead of seconds for values that would otherwise be displayed as '0.000'

(the display may have to be tweaked for non-utf8 users, as the µ character is used)


Example output:

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     9827    0.007      7µs    0.007      7µs {method 'get' of 'dict' objects}
     3427    0.009     25µs    0.017     49µs {map}
    10701    0.006      5µs    0.006      5µs {method 'lower' of 'str' objects}
    31410    0.045     14µs    0.045     14µs {method 'split' of 'str' objects}
    10023    0.006      6µs    0.006      6µs {_weakref.proxy}
    31801    0.009      2µs    0.009      2µs {len}
     3892    0.003      7µs    0.003      7µs {method 'extend' of 'list' objects}
     1397    0.001      8µs    0.001      8µs {method 'replace' of 'str' objects}
    10488    0.010      9µs    0.010      9µs {method 'string_literal' of '_mysql.connection' objects}
    10702    2.620   2447µs    2.620   2447µs {method 'readline' of 'file' objects}
    10023    0.004      3µs    0.004      3µs {method 'info' of '_mysql.connection' objects}
    10023    0.005      5µs    0.005      5µs {method 'insert_id' of '_mysql.connection' objects}
    14327    0.022     15µs    0.022     15µs {method 'rstrip' of 'str' objects}
History
Date User Action Args
2015-04-30 16:27:51Romualdsetrecipients: + Romuald
2015-04-30 16:27:51Romualdsetmessageid: <1430411271.93.0.999844602202.issue24084@psf.upfronthosting.co.za>
2015-04-30 16:27:51Romualdlinkissue24084 messages
2015-04-30 16:27:51Romualdcreate