Jump to content
  • 0

timing of execution of function


Platonic

Question

Posted

would like to print the timing of a function.
timing = the timing it takes for execute a function.
why? Like that i can partly see what would be more efficient for how i writhe my script.

2 answers to this question

Recommended Posts

Posted

"os.clock" function can be used to measure elapsed time: 

local start = os.clock()
-- code to measure execution time of 
local execTime = os.clock() - start
print("Execution took " .. exexTime .. " seconds")
Posted
On 3/3/2022 at 11:07 PM, CmP said:

"os.clock" function can be used to measure elapsed time: 

local start = os.clock()
-- code to measure execution time of 
local execTime = os.clock() - start
print("Execution took " .. exexTime .. " seconds")

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.