python run code at the same time

Solutions on MaxInterview for python run code at the same time by the best coders in the world

showing results for - "python run code at the same time"
Leo
10 Jan 2019
1def a():
2    print("Function a is running at time: " + str(int(time.time())) + " seconds.")
3
4def b():
5    print("Function b is running at time: " + str(int(time.time())) + " seconds.")
6
7threading.Thread(target=a).start()
8OUTPUT
9Function a is running at time: 1585338789 seconds.
10threading.Thread(target=b).start()
11OUTPUT
12Function b is running at time: 1585338789 seconds.