def _ui_event_loop(self):
self._sem.acquire()
if self._profile:
import StringIO
import cProfile
import pstats
pr = cProfile.Profile()
pr.enable()
self._ui.start(self)
if self._profile:
pr.disable()
s = StringIO.StringIO()
ps = pstats.Stats(pr, stream=s)
ps.strip_dirs().sort_stats(self._profile).print_stats(30)
self._profile = s.getvalue()
评论列表
文章目录