Skip to content

Commit

Permalink
Merge pull request #6032 from Gordo-Master/#15-Python
Browse files Browse the repository at this point in the history
#15-Python
  • Loading branch information
Roswell468 authored Sep 10, 2024
2 parents bf95d51 + e4c22e1 commit 3eaa88c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Roadmap/15 - ASINCRONÍA/python/Gordo-Master.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 15 - Asincronia

import asyncio
from datetime import datetime

async def call_name(name,time_to_wait):
print(datetime.now().time().strftime(f"Comienza función: {name}: %X, durara {time_to_wait} segundos"))
await asyncio.sleep(time_to_wait)
print(datetime.now().time().strftime(f"Termina funcion {name}: %X"))

# asyncio.run(call_name("Gordo Master",2))

"""
Ejercicio Extra
"""
async def main():

await asyncio.gather(
call_name("C",3),
call_name("B",2),
call_name("A",1)
)

await call_name("D",1)

asyncio.run(main())

0 comments on commit 3eaa88c

Please sign in to comment.