from time import sleep
from threading import Timer

def setTimeout(f):
    f()
def test_function():
    print 'test'

Timer(2.5,setTimeout,args = [test_function]).start()
for i in range(5):
    print i
    sleep(1)