| from fastapi import FastAPI | |
| import time | |
| import asyncio | |
| app = FastAPI() | |
| async def root(): | |
| return {"message": "PGAI API"} | |
| def info_sync(): | |
| print("sync") | |
| time.sleep(5) | |
| return {"message": "sync"} | |
| async def info_async(): | |
| print("async") | |
| await asyncio.sleep(5) | |
| return {"message": "async"} | |