1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/usr/bin/python import cups import cupshelpers import hotshot import hotshot.stats ppds = cupshelpers.ppds.PPDs (cups.Connection ().getPPDs ()) prof = hotshot.Profile ("a.prof") prof.runcall (lambda: ppds.getPPDNameFromDeviceID('','','')) prof.close () stats = hotshot.stats.load ("a.prof") stats.sort_stats ('time') stats.print_stats (100) |