指定時間後に実行されます
import logging
import threading
import time
logging.basicConfig(level=logging.DEBUG, format='%(threadName)s: %(message)s')
def worker(x, y=1):
logging.debug('start')
logging.debug(x)
logging.debug(y)
time.sleep(2)
logging.debug('end')
if __name__ == '__main__':
t = threading.Timer(3, worker, args=(100,), kwargs={'y': 200})
t.start()
Thread-1: start
Thread-1: 100
Thread-1: 200
Thread-1: end