# What is that registerAfterRender and onBeforeRenderObservable

**URL:** <https://forum.babylonjs.com/t/what-is-that-registerafterrender-and-onbeforerenderobservable/28013>\
**Category:** Questions\
**Tags:** documentation, tutorial\
**Created:** [February 28, 2022, 4:45pm UTC](https://forum.babylonjs.com/t/what-is-that-registerafterrender-and-onbeforerenderobservable/28013 "2022-02-28T16:45:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenifer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jenifer/32/47234_2.png) [@Jenifer](https://forum.babylonjs.com/u/Jenifer)\
**Post date:** [February 28, 2022, 4:45pm UTC](https://forum.babylonjs.com/t/what-is-that-registerafterrender-and-onbeforerenderobservable/28013/1 "2022-02-28T16:45:20Z")

</div>

**where we can use both…**

scene.onBeforeRenderObservable.add(() =\> {  
//code to execute  
});

scene.registerAfterRender(function () {  
});

Please any one help me…

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 28, 2022, 5:21pm UTC](https://forum.babylonjs.com/t/what-is-that-registerafterrender-and-onbeforerenderobservable/28013/2 "2022-02-28T17:21:24Z")

</div>

Hey!

It totally depends on your need. If you need to run something before the frame is rendered or before it is sent to the driver (AfterRender).

99.9% of the time you will see no difference. The AfterRender is used internally to measure the duration of the frame render for instance

---

<div class="post-metadata">

**Author:** ![Jenifer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jenifer/32/47234_2.png) [@Jenifer](https://forum.babylonjs.com/u/Jenifer)\
**Post date:** [February 28, 2022, 11:45pm UTC](https://forum.babylonjs.com/t/what-is-that-registerafterrender-and-onbeforerenderobservable/28013/3 "2022-02-28T23:45:25Z")

</div>

Thankyou so much @Deltakosh 🥰
