view light8/profilereport.py @ 326:a3267d8c498e

leave in a comment about how to offset the audio time in case your sound card is lying we didn't eventually need this because we found a good-sounding card that could report offset correctly. But if you're stuck with a card that reports offset incorrectly, you can play with this offset for a partial workaround. note that song intros will probably still be corrupted (but you could workaround that by prepending some silence)
author Drew Perttula <drewp@bigasterisk.com>
date Sun, 18 Jun 2006 22:01:41 +0000
parents 45b12307c695
children
line wrap: on
line source

"""
tweak rsn.py to run the profile module, and write the output to files
in profile/ with names that describe how you exercised the
program. then run this program to make files in profile/html/ for
easier viewing.
"""

import pstats,glob,os,time,sys

allfiles = glob.glob("profile/*")
allfiles.remove('profile/html')
allfiles.sort()

header = "profile output from %s<p>" % (time.ctime())
for f in allfiles:
    f=f[8:]
    header = header+"<a href=%(f)s.html>%(f)s</a> | " % locals()

for profileoutput in allfiles:


    
    s=pstats.Stats(profileoutput)

    f=open("profile/html/%s.html" % profileoutput[8:],'w')
    sys.stdout=f
    print header,"<pre>"
    s.sort_stats('cumulative').print_stats(15).print_callers(15)
    print "</pre>"