# Count of diff eq callbacks

**URL:** <https://discourse.julialang.org/t/count-of-diff-eq-callbacks/121546>\
**Category:** General Usage\
**Tags:** diffeq, diffeqcallbacks\
**Created:** [October 21, 2024, 5:39pm UTC](https://discourse.julialang.org/t/count-of-diff-eq-callbacks/121546 "2024-10-21T17:39:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Egwene\_al\_Vere](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Post date:** [October 21, 2024, 5:39pm UTC](https://discourse.julialang.org/t/count-of-diff-eq-callbacks/121546/1 "2024-10-21T17:39:18Z")

</div>

using [DiscreteCallback](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/#SciMLBase.DiscreteCallback), is there a built-in way to know the number of times the affect! function is called both inside the affect! function and after solve/step! call is completed? current;y, i’m using a ref value in the p parameter of the integrator as

```julia
p=(;c=Ref(0))

```

and doing `integrator.p.c[] += 1` inside the callback function. Is this info already built-in in the integrator or solution object? The `ncondition` in DEStats shows =condition function call count, not affect call count…
