# Number of integration steps used in DifferentialEquations.jl with save\_everystep=false

**URL:** <https://discourse.julialang.org/t/number-of-integration-steps-used-in-differentialequations-jl-with-save-everystep-false/38575>\
**Category:** Numerics\
**Created:** [May 1, 2020, 8:27pm UTC](https://discourse.julialang.org/t/number-of-integration-steps-used-in-differentialequations-jl-with-save-everystep-false/38575 "2020-05-01T20:27:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [May 1, 2020, 8:27pm UTC](https://discourse.julialang.org/t/number-of-integration-steps-used-in-differentialequations-jl-with-save-everystep-false/38575/1 "2020-05-01T20:27:15Z")

</div>

Do solvers in `DifferentialEquations.jl` count the number of integration steps they used? `length(sol)` is close because it returns the number of recorded solutions, but if I use `save_everystep=false` for speedup, `length(sol)` is `2` because only the initial and final solutions are recorded.

For example,

```julia
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob)

```

gives `length(sol)==5`, but if I change the last line to

```julia
sol = solve(prob, save_everystep=false)

```

then I get `length(sol)==2`.

I think I can count the number of integration steps using `DiscreteCallback`, but I want to make sure I am not reinventing the wheel.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 1, 2020, 10:27pm UTC](https://discourse.julialang.org/t/number-of-integration-steps-used-in-differentialequations-jl-with-save-everystep-false/38575/2 "2020-05-01T22:27:13Z")

</div>

`sol.destats` has a bunch of stats, but I am not sure that one is counted.
