If you want to measure how much time your Redis Lua script takes to be executed, you can use Redis’ TIME command to get the current server time during the start of the script and the end of the script.

Measuring the difference between the finish and the start points, you can check the duration of the execution of the script.

Add the following lines to your Redis Lua script:

local start = redis.call('TIME')

-- your logic here

local finish = redis.call('TIME')

return finish[2] - start[2]