Skip to content

Instantly share code, notes, and snippets.

@nvdv
Last active October 4, 2016 10:02
Show Gist options
  • Save nvdv/48ec426034e7422297660d948da39b7d to your computer and use it in GitHub Desktop.
Save nvdv/48ec426034e7422297660d948da39b7d to your computer and use it in GitHub Desktop.
How profilers work - running with stats
stats = defaultdict(lambda: defaultdict(float))
start_time = time.time()
primes = get_primes(1000)
total_time = time.time() - start_time
print("Total time is %f s" % total_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment