<p>I'm just trying to time a piece of code. The pseudocode looks like:</p>

<pre><code>start = get_ticks()
do_long_code()
print "It took " + (get_ticks() - start) + " seconds."
</code></pre>

<p>How does this look in Python?</p>

<p>More specifically, how do I get the number of ticks since midnight (or however Python organizes that timing)?</p>

What you need is
```
time()
```
function from
```
time
```
module:
```
```
import time
start = time.time()
do_long_code()
print "it took", time.time() - start, "seconds."
```
```
You can use
timeit
module for more options though.