I want to make a function in python that runs every 5 seconds until a variable reaches 100%
<p>So I would like to create a function that prints out the progress of the rebuild and the time left to finish this rebuild. But it needs to end once the rebuild reaches 100%. This is what I have so far:</p>

<pre><code>def progress():
    # This prints out the time left until rebuild is done.
    loudEchoCMD("storage::rebuild-eta")
    # This prints out the % of the rebuild that is done.
    rebuildProgress = loudEchoCMD("storage::rebuild-progress") 
    print rebuildProgress 
    if rebuildProgress != '100%':
        global t 
        t = threading.Timer(5.0, progress)
        t.start()
    else:
        t.cancel()
</code></pre>

<p>When I start the rebuild process it will first finish that and then start the threading instead of having the threading print out the progress and the ETA every five seconds.</p>
