HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Python311/Tools/scripts/startuptime.py
# Quick script to time startup for various binaries

import subprocess
import sys
import time

NREPS = 100


def main():
    binaries = sys.argv[1:]
    for bin in binaries:
        t0 = time.time()
        for _ in range(NREPS):
            result = subprocess.run([bin, "-c", "pass"])
            result.check_returncode()
        t1 = time.time()
        print(f"{(t1-t0)/NREPS:6.3f} {bin}")


if __name__ == "__main__":
    main()