How do I pause this thread after x minutes
<p>How to pause this thread from running every 300 seconds for 500 seconds? I need to suspend it from running all the functions every x minutes to prevent API breaches. Timer objects seem to only start the code, whereas the objective is to pause, wait, resume.</p>

<pre><code>from TwitterFollowBot import TwitterBot
from threading import Thread
import random

my_bot = TwitterBot()
my_bot.sync_follows()


def a():
    my_bot.auto_fav("@asco", count=1000)

def b():
    my_bot.auto_fav("ATSO", count=1000)

def c():
    my_bot.auto_fav("BCY3", count=1000)

lof = [a, b, c]
random.shuffle(lof)

for z in lof:
    Thread(target=z).start()
</code></pre>

<p>Credit to @Farhan.K for assisting with the code.</p>

<p>Maybe something like this for your threads?</p>

<pre><code>import time


def sleep_thread(sleepWait, sleepTime):
    timeStart = time.time()
    timeElapsed = 0 

    while timeElapsed &lt;= sleepWait:
        timeElapsed = time.time() - timeStart
        print 'time elapsed = ' + str(timeElapsed)
        time.sleep(1)

    print 'going to sleep. zzz....'
    # Sleep for x 
    time.sleep(sleepTime)
    print 'im awake!'


sleep_thread(5, 3)
</code></pre>

python multithreading bots python-multithreading