pyperf_tryout.py 322 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. __author__ = "Christian Heider Nielsen"
  4. __doc__ = r"""
  5. Created on 15-10-2020
  6. """
  7. import pyperf
  8. runner = pyperf.Runner()
  9. runner.timeit(
  10. name="sort a sorted list",
  11. stmt="sorted(s, key=f)",
  12. setup="f = lambda x: x; s = list(range(1000))",
  13. )