How can I know in Python how many times a line of code is executed per minute?
<p>For example if I have:  </p>

<pre><code> something=something+1 
</code></pre>

<p>I want to know how many times in a minute, this line is executed in order to create another variable with this result? </p>

<p>I suppose you are trying to do some basic benchmarking, in this case it would go like this:</p>

<pre><code>import time
start = int(round(time.time() * 1000))

something = 0

while something &lt; 1000000:
    something = something + 1

delta = int(round(time.time() * 1000)) - start

print "loop ran 1000000 times in {0:0d} milliseconds".format(delta)
</code></pre>

python loops time