# How to correctly measure inference time?

**URL:** <https://discuss.huggingface.co/t/how-to-correctly-measure-inference-time/20851>\
**Category:** Intermediate\
**Created:** [July 25, 2022, 6:37pm UTC](https://discuss.huggingface.co/t/how-to-correctly-measure-inference-time/20851 "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](https://discuss.huggingface.co/u/sandmaker)\
**Post date:** [July 25, 2022, 6:37pm UTC](https://discuss.huggingface.co/t/how-to-correctly-measure-inference-time/20851/1 "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?
