title: How to execute a code for a given time period
body: <p>I want to know if there is a way in python 2.7 to run code for just for a given time, like 3600 seconds. The time can variate from one execution to an other. 
   Any ideas are welcome since I am stuck with this issue. </p>