cProfile, a function call-based profiling tool, is not effective in profiling the execution time of asynchronous operations. This article introduces pyinstrument, a profiling library, combined with the FastAPI.middleware decorator, and uses speedscope to visualize the time consumption of FastAPI programs.