# BenchmarkTools.jl alternative for Python?

**URL:** <https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754>\
**Category:** Offtopic\
**Tags:** question, benchmark, benchmarktools, python, profiling\
**Created:** [January 17, 2022, 11:11am UTC](https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754 "2022-01-17T11:11:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NightMachinary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nightmachinary/32/14196_2.png) [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Post date:** [January 17, 2022, 11:11am UTC](https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754/1 "2022-01-17T11:11:09Z")

</div>

I need to benchmark some algorithms in Python, and I can’t find anything that runs some code multiple times and reports its time and peak memory usage.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 17, 2022, 11:35am UTC](https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754/2 "2022-01-17T11:35:56Z")

</div>

Maybe you should ask in a Python forum?

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [January 17, 2022, 11:57am UTC](https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754/3 "2022-01-17T11:57:25Z")

</div>

[`timeit`](https://docs.python.org/3/library/timeit.html)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [January 17, 2022, 12:08pm UTC](https://discourse.julialang.org/t/benchmarktools-jl-alternative-for-python/74754/4 "2022-01-17T12:08:53Z")

</div>

The easiest way I found is using `IPython` and the `%timeit` macro.
