summaryrefslogtreecommitdiff
path: root/misc/threadDemo.py
blob: 1410b95de1c45e99e11c383e702966dfe9af8bbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! python3

# threadDemo.py

import time
import threading

print('Start of program.')

def takeANap():
    time.sleep(5)
    print('Wake up!')

threadObj = threading.Thread(target=takeANap)
threadObj.start()

print('End of program.')