0

I am trying to understand the Google JAX framework, which is a collection of tools to speed up various forms of (matrix) computations.

In all the examples (e.g. official readthedocs.io) that I come across this is illustrated with comparing "naive" computations with JAX computations, using %timeit. I kept running into errors until I discovered that this is a Jupyter/iPython magic function.

I think Jupyter/iPython is an amazing tool, especially for communicating something (a paper, etc.). But for tinkering I prefer a tool like Spyder or even Thonny, which makes it easier to keep track of what all the variables and functions in memory are.

What is the equivalent form of %timeit that I can use to replace %timeit in regular Python (from the timeit package I assume)?

Bastiaan Quast
  • 2,802
  • 1
  • 24
  • 50
  • 1
    use the timeit library – itprorh66 Jun 20 '22 at 23:50
  • [itprorh65](https://stackoverflow.com/users/14249087/itprorh66) what would the exact command that is equivalent to %timieit (from the `timeit` library) be? – Bastiaan Quast Jun 21 '22 at 04:55
  • That would depend on what you want to do, suggest you read the timeit docs, and then when you have a specific issue ask a detailed question. It isn't the job of Stackoverflow to do your work – itprorh66 Jun 21 '22 at 15:48
  • 1
    [fastero - Python timeit CLI for the 21st century](https://github.com/wasi-master/fastero), or pyinstrument. For the latter, see an example with a script at the very bottom [here](https://stackoverflow.com/a/72407678/8508004). – Wayne Jun 21 '22 at 18:35

0 Answers0