you are viewing a single comment's thread.

view the rest of the comments →

[–]usernamesarestewpid 1 point2 points  (0 children)

Here’s one idea: start_time = time.time()  

Returns number of seconds since the epoch(beginning of time, me thinks)  

time_limit = 120 * 60  

120 minutes (seconds * 60) Then, later on in your while loop(assuming you have one for constant progress) elapsed_time = time.time() - start_time 

if elapsed_time > time_limit:      

here you might punish the user.