Check precise timing

Hello,
I want to check the precise timing of real time and virtual time of the simulation. I have my Python code, I want to simulate and get the amount of time the simulation takes during each iteration and run of code (loop). How to get the time of each iteration of the loop.
I am using SimTime but its the virtual simulation time. I wanna get the real world run time of each loop executed.
Also how to find the simulation time vs real time ratio.
Thanks.

Hey haroon,

if you pick “Real Time” under Simulation mode (the small gear symbol at the top of the screen) you should get the real times with SimTime.

Best regards
Dubsepp

The time module in python might be what you are looking for.

from vcScript import *
import time

t1 = time.time()
for i in xrange(10000):
  a = i/(i+10)
t2 = time.time()
print t2-t1

 

@Dubs3pp
No, its been a minute and the real time is still in 0:00:00

@eme
thanks but this gives the time of each loop of i in xrange(10000): right ?
and why a = i/(i+10) ??

@eme
thanks but this gives the time of each loop of i in xrange(10000): right ?
and why a = i/(i+10) ??