# Confuse about SceneInstrument caling fetchNewFrame

**URL:** https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840
**Category:** Questions
**Created:** [May 16, 2023, 3:06am UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840 "2023-05-16T03:06:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tobepeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tobepeter/32/32117_2.png) [@Tobepeter](https://forum.babylonjs.com/u/Tobepeter)
#### Post date: [May 16, 2023, 3:06am UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840/1 "2023-05-16T03:06:54Z")

</div>

focus on the **SceneInstrument** filed **\_activeMeshesEvaluationTime**  
it is a instance of **PerfCounter**

**PerfCounter** is like a sampler collector and calculate like **avg = total/sampleTimes**  
And increasing the sampleTimes by **fetchNewFrame**  
**fetchNewFrame** also can call by **endMonitoring** when using default parameter

My Question is:  
**\_activeMeshesEvaluationTime** have fetchNewFrame in

1. scene.onBeforeAnimationsObservable
2. onAfterActiveMeshesEvaluationObservable

I think is it calling fetchNewFrame more than one time?

**avg = total/sampleTimes**  
we just increase the sampleTimes but total not changing  
maybe we should remove 1. scene.onBeforeAnimationsObservable ?

---

<div class="post-metadata">

### Author: ![Tobepeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tobepeter/32/32117_2.png) [@Tobepeter](https://forum.babylonjs.com/u/Tobepeter)
#### Post date: [May 16, 2023, 4:04am UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840/2 "2023-05-16T04:04:29Z")

</div>

And I also find that  
**onBeforeActiveMeshesEvaluationObservable** is only called  
but **onAfterActiveMeshesEvaluationObservable** not called in the engine

I think it is a bug too，the engine forgot to called it  
git commit hash15435c89d8dcad58b68852c6f4808b48fb8f6b  
engine version **6.3.1**

---

<div class="post-metadata">

### Author: ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)
#### Post date: [May 16, 2023, 11:38am UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840/3 "2023-05-16T11:38:44Z")

</div>

cc @sebavan

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [May 16, 2023, 8:27pm UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840/4 "2023-05-16T20:27:57Z")

</div>

Looks like you are spot on with both issues, I ll try to fix it ASAP.

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [May 16, 2023, 9:30pm UTC](https://forum.babylonjs.com/t/confuse-about-sceneinstrument-caling-fetchnewframe/40840/5 "2023-05-16T21:30:47Z")

</div>

> [@Tobepeter](#):
>
> \_activeMeshesEvaluationTime

Will be fixed by [Fix Scene performance counters by sebavan · Pull Request #13870 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/13870)
