# Performance measure of some block of code?

**URL:** <https://forum.inductiveautomation.com/t/performance-measure-of-some-block-of-code/26717>\
**Category:** Module Development\
**Tags:** ignition79\
**Created:** [July 19, 2019, 2:37pm UTC](https://forum.inductiveautomation.com/t/performance-measure-of-some-block-of-code/26717 "2019-07-19T14:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [July 19, 2019, 2:37pm UTC](https://forum.inductiveautomation.com/t/performance-measure-of-some-block-of-code/26717/1 "2019-07-19T14:37:55Z")

</div>

I’m looking for a way to make some performance measure.  
Is there some built-in feature in the SDK to obtain the time elapsed beetween 2 call of theses functions.  
(with thread safe support)  
can we use as well these function in gateway and client script to do the same job.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 21, 2019, 5:52pm UTC](https://forum.inductiveautomation.com/t/performance-measure-of-some-block-of-code/26717/2 "2019-07-21T17:52:09Z")

</div>

There’s nothing built in.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 21, 2019, 6:47pm UTC](https://forum.inductiveautomation.com/t/performance-measure-of-some-block-of-code/26717/3 "2019-07-21T18:47:22Z")

</div>

You should roll your own as part of the function using [System.nanoTime()](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--). You need a static or instance field to hold the prior invocation’s value to compute a delta.
