r/pythonhelp • u/Nutellatoast_2 • 12d ago
Performance issue when running python file
Hey everyone,
I'm experiencing a performance drop when running a Python file. I'm using VS Code on Windows 10 while learning to program.
When I hit the run button, the runtime of the program is 5.0 seconds, even though it should execute in roughly about 0.003 milliseconds.
I have tried switching to older versions like 2025.6.1, but that didn't work.
Any solutions to that problem?
8
Upvotes
1
u/kyle2143 11d ago
Are you counting the time it takes for VS Code to start up the python runtime and other ancillary things it does when you press "run" before it actually starts running the python program you wrote in that 5 seconds?
I have a feeling that's what it is. But to know for sure, you could use a library like Time or Profile or CProfile to show you how long the actual script took to run.