Hello,
I have developed motion planning functionality(in a threaded child script), and I would like to measure the performance of this planning function. I am thinking of using the run time as a measure. Is there a way in coppeliaSim to calculate the run/execution time of a specific block of code in a child script?
Cheers,
Calculate run/execution time
Re: Calculate run/execution time
Hi,
you can simply do
you can simply do
Code: Select all
local t_start=sim.getSystemTime()
-- long computation ...
local t_end=sim.getSystemTime()
local elapsed=t_end-t_start
Re: Calculate run/execution time
Thank you for your answer. But is there a definition for the time used, does it depend on the system architecture (CPU, RAM,..)?
Another important question how can I measure the computational effort or the CPU utilization for this function in CoppeliaSim?
Thank you a lot for the constant support and engagement.
Another important question how can I measure the computational effort or the CPU utilization for this function in CoppeliaSim?
Thank you a lot for the constant support and engagement.
Re: Calculate run/execution time
If you use
About the computational effort... that is more difficult. Probably there is a tool that allows to inspect those values with more details than what is available on Windows task manager for instance.
Cheers
sim.getSystemTimeInMs
then you can see what kind of underlying API functions are used. But basically, those functions only make sense to measure time differences. No absolute times.About the computational effort... that is more difficult. Probably there is a tool that allows to inspect those values with more details than what is available on Windows task manager for instance.
Cheers