Page 1 of 1

How to get the simulation time

Posted: 10 Jan 2019, 11:32
by narutom
hey,guys.

I want to know how to get the time running in V-rep.
I use the SetJointTarjectPosition to control the joint, but it was completed in 0.5 seconds.
I plan to wait until 1 second,then give the next target joint angle.
So, I have to check if the real-time running in V-rep has reached 1 second.
I know that the simxGetLastCmdTime can get the simulation time, but that is the time of the last fetched command.
I want to know how to get the real-time running in V-rep but not the API finish time. Is there any API can make it?

Thanks.

Re: How to get the simulation time

Posted: 11 Jan 2019, 09:47
by coppelia
Hello,

if your controller is in V-REP, then use sim.getSystemTimeInMs for the real-time. Otherwise sim.getSimulationTime for the simulation time.

Cheers