title: Run two python functions simultaneously with sleep
body: <p>I have two functions but I can't get them to run all the time with the <code>foo()</code> function that sleeps for some time.</p>
  
  <pre><code>import time
  
  filename = "test.dat"
  
  def foo():
      print "It deletes dat file and creates a new one"
      time.sleep(xxx)
  
  def bar():
      print "Writes to dat file"
  
  while True:
      foo()
      bar()
  </code></pre>