Untitled
unknown
python
20 days ago
984 B
4
Indexable
# import asyncio
import time
def make_tea():
start = time.perf_counter()
print("[HERBATA] Wstawiam wodę...")
time.sleep(3)
elapsed = time.perf_counter() - start
print(f'[HERBATA] Gotowa po {elapsed:.2f} s')
def make_sandwich():
start = time.perf_counter()
print("[KANAPKA] Robię kanapkę...")
time.sleep(2)
elapsed = time.perf_counter() - start
print(f"[KANAPKA] Gotowe po {elapsed:.2f} s")
def wash_dishes():
start = time.perf_counter()
print("[NACZYNIA] Myję naczynia...")
time.sleep(4)
elapsed = time.perf_counter() - start
print(f"[NACZYNIA] Gotowe po {elapsed:.2f} s")
def main():
global_start = time.perf_counter()
print("=== START PROGRAMU ===")
make_tea()
make_sandwich()
wash_dishes()
total = time.perf_counter() - global_start
print(f"\n=== KONIEC PROGRAMU ({total:.2f} s) ===")
if __name__ == '__main__':
main()
Editor is loading...
Leave a Comment