# Benchmarking lua code

**URL:** <https://forum.electra.one/t/benchmarking-lua-code/2809>\
**Category:** Developers\
**Created:** [April 5, 2024, 1:43pm UTC](https://forum.electra.one/t/benchmarking-lua-code/2809 "2024-04-05T13:43:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mint-Gecko](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Mint-Gecko](https://forum.electra.one/u/Mint-Gecko)\
**Post date:** [April 5, 2024, 1:43pm UTC](https://forum.electra.one/t/benchmarking-lua-code/2809/1 "2024-04-05T13:43:01Z")

</div>

Is there a way to benchmark LUA code on the E1? I tried using `os.clock()` but that one is unavailable.

Right now, I’m commenting out code if that’s easily possible without breaking stuff but I wish there was a quicker and safer way.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [April 5, 2024, 2:01pm UTC](https://forum.electra.one/t/benchmarking-lua-code/2809/2 "2024-04-05T14:01:35Z")

</div>

you can use `controller.uptime()`. It returns time elapsed since the system start up (in msecs).

---

<div class="post-metadata">

**Author:** ![Mint-Gecko](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Mint-Gecko](https://forum.electra.one/u/Mint-Gecko)\
**Post date:** [April 6, 2024, 4:20pm UTC](https://forum.electra.one/t/benchmarking-lua-code/2809/3 "2024-04-06T16:20:37Z")

</div>

Thanks, that’s what I was looking for!

Is there a way to benchmark other parts of the system like how long it took for an incoming message to get processed until it was made available to the lua script or how long it took to make a control visible on the screen?
