Print sync
- First let's see a few small and useless examples.
- In this example we wait and print sequentially. No async here.
import time
def say(text, sec):
time.sleep(sec)
print(text)
def main():
start = time.monotonic()
say("First", 2)
say("Second", 1)
end = time.monotonic()
print(f"Elapsed: {end-start}")
main()
First
Second
Elapsed: 3.0015416080132127