# BenchmarkTools setup isn't run between each iteration?

**URL:** <https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258>\
**Category:** General Usage\
**Tags:** question, benchmarktools\
**Created:** [March 20, 2020, 12:59pm UTC](https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258 "2020-03-20T12:59:54Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [March 20, 2020, 2:04pm UTC](https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258/6 "2020-03-20T14:04:10Z")

</div>

`evals` is just another keyword argument, like `setup`:

```julia
julia> @btime sort!(x) setup=(x = rand(5)) evals=1
  38.000 ns (0 allocations: 0 bytes)
5-element Array{Float64,1}:
 0.27202634588420826
 0.3043204769033667 
 0.38124617952216444
 0.44094427015230697
 0.4785747961346507 

```

or, with more parentheses for clarity:

```julia
julia> @btime(sort!(x), setup=(x = rand(5)), evals=1)
  43.000 ns (0 allocations: 0 bytes)
5-element Array{Float64,1}:
 0.2818970773419529
 0.6447645561336768
 0.7669354473160204
 0.789996892969342 
 0.8448189472593695

```

---

_[View the full topic](https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258)._
