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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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.