@ptrblck Thanks!
The motivation I ask this is because I am designing a real time scheduler for model inference.
When there’s no workload in the system (system idle waiting for requests) and then an inference request comes and starts to be processed on GPU, it gives the unstable inference time, just like the situation of using time.sleep(). When GPU is busy processing some data and then immediately switches to new data,  the inference time of these new data is quite normal.
Also I tried time.perf_counter to replace torch.event,  it gives similar results.
I hope this provides more context information for this problem.
Thank you very much!