Record FPS to file

Hi

I would like to ask how can I record the FPS rate when running the pipeline. I want to record FPS and analyze it when the pipeline finishes.

Thanks