tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bench.py (347B)


      1 import sys
      2 
      3 
      4 if __name__ == "__main__":
      5    import cProfile
      6    import pstats
      7 
      8    import pytest  # noqa: F401
      9 
     10    script = sys.argv[1:] if len(sys.argv) > 1 else ["empty.py"]
     11    cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
     12    p = pstats.Stats("prof")
     13    p.strip_dirs()
     14    p.sort_stats("cumulative")
     15    print(p.print_stats(500))