title: Python Game Timer (Threads?)
body: <p>I am designing a game in Python and would like to know how to make an efficient timer that can run along side my game.</p>
  
  <p><strong>Note: I am using Pygame.</strong></p>
  
  <p>I currently have a timer like so:</p>
  
  <pre><code>import time
  
  seconds = 60
  
  def start_timer():
      global seconds
      while seconds &gt; 0:
          print seconds
          seconds -= 1
          time.sleep(1)
  </code></pre>
  
  <p>However, when run in my main game function my game hangs because of the <code>timer.sleep</code>.</p>
  
  <pre><code>def main(self):
      Timer.start_timer()
  </code></pre>
  
  <p>I'm pretty sure my issue has something to do with not using threading, although I'm not 100% sure. Can somebody help explain to me what the proper solution is?</p>