How to calculate tokens per second while fine-tuning llm?

Hi, I am trying to fine-tune an seq2seq LLM and I want to calculate the tokens per second, so how can I achieve this ?