mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-18 06:30:23 -04:00
20 lines
No EOL
316 B
Python
20 lines
No EOL
316 B
Python
import time
|
|
import threading
|
|
|
|
counter = 0
|
|
threads = []
|
|
|
|
def count():
|
|
global counter
|
|
for _ in range(100):
|
|
counter += 1
|
|
|
|
for _ in range(100):
|
|
thread = threading.Thread(target=count)
|
|
thread.start()
|
|
threads.append(thread)
|
|
|
|
for thread in threads:
|
|
thread.join()
|
|
|
|
print(f"Count: {counter}") |