2

When I was executing my python code with code-runner, it showed the result in the "Output" with the elapsed time.

[Done] exited with code=0 in 179.605 seconds

I switched to using the terminal and I no longer know how long my program took to execute.

I am aware that I can manually set a timer and print it.

But is there an option to do it in .vscode/settings.json ?

"code-runner.executorMap": {
   "python": "$pythonPath $fullFileName",
   }
"code-runner.runInTerminal": true

Or any other way. I've seen it done like the picture below.

VS Code terminal with execution time shown

typhon04
  • 2,350
  • 25
  • 22

1 Answers1

4

Try time python <your_python_file.py> in the terminal.

test
  • 207
  • 2
  • 10