Skip to content

Instantly share code, notes, and snippets.

@rawdigits
Created October 30, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawdigits/038c4d001238d9b52a5a to your computer and use it in GitHub Desktop.
Save rawdigits/038c4d001238d9b52a5a to your computer and use it in GitHub Desktop.
p = cProfile.Profile()
p.enable()
counter = 1
def profiler_write_cb(data, remaining):
global counter, p
p.dump_stats('/tmp/stats/asdf_{}'.format(counter))
p.enable()
counter += 1
return w.WEECHAT_RC_OK
w.hook_timer(1000 * 5, 0, 0, "profiler_write_cb", “")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment