# How to correctly measure inference time?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-correctly-measure-inference-time%2F20851%3E%5C
**Category:** Intermediate\
**Created:** [July 25, 2022, 6:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-correctly-measure-inference-time%2F20851 "2022-07-25T18:37:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandmaker](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@sandmaker](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsandmaker)%5C
**Post date:** [July 25, 2022, 6:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-correctly-measure-inference-time%2F20851%2F1 "2022-07-25T18:37:31Z")

</div>

I am trying to compare the inference time of different Huggingface models with different batch sizes. But am not sure if I should use **per\_device\_train\_batch\_size** , **per\_device\_eval\_batch\_size** , both or some other method. What is the correct way to do it with the trainer API?
