1#use threading instead of multiprocessing
2#by @devDavmen
3## EXAMPLE 101 ##
4import threading
5
6def a():
7 print("Function a is running at time: " + str(int(time.time())) + " seconds.")
8
9
10def b():
11 print("Function b is running at time: " + str(int(time.time())) + " seconds.")
12
13threading.Thread(target=a).start()
14## OUTPUT >>> Function a is running at time: 1585338789 seconds.
15threading.Thread(target=b).start()
16## OUTPUT >>> Function b is running at time: 1585338789 seconds.
17
18
19## EXAMPLE 2 ##
20import threading
21
22def f():
23 print "abc"
24
25thread = threading.Thread(target=f)
26thread.start()
27## OUTPUT >> abc