# About cycle time qtr library

**URL:** https://forum.pololu.com/t/about-cycle-time-qtr-library/8884
**Category:** Sensors
**Created:** [March 2, 2016, 10:45pm UTC](https://forum.pololu.com/t/about-cycle-time-qtr-library/8884 "2016-03-02T22:45:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fbasaris](https://forum.pololu.com/letter_avatar_proxy/v4/letter/f/54ee81/32.png) [@fbasaris](https://forum.pololu.com/u/fbasaris)
#### Post date: [March 2, 2016, 10:45pm UTC](https://forum.pololu.com/t/about-cycle-time-qtr-library/8884/1 "2016-03-02T22:45:57Z")

</div>

Hi,  
when we use this code line;  
unsigned int position = qtra.readLine(sensorValues);  
what is the cycle time ?  
How long is take to calculate the position data??

---

<div class="post-metadata">

### Author: ![nathanb](https://forum.pololu.com/user_avatar/forum.pololu.com/nathanb/32/799_2.png) [@nathanb](https://forum.pololu.com/u/nathanb)
#### Post date: [March 3, 2016, 9:06pm UTC](https://forum.pololu.com/t/about-cycle-time-qtr-library/8884/2 "2016-03-03T21:06:36Z")

</div>

Hello.

The amount of time the function takes depends on many things including the number of sensors you are reading, the timeout value you specify for your sensors, and the reflectivity of the surfaces you are measuring. If you want more information about how long the function is taking in your setup, you might consider using the [millis()](https://www.arduino.cc/en/Reference/Millis) or [micros()](https://www.arduino.cc/en/Reference/Micros) Arduino functions to get timestamps before and after running the function to then calculate the length of time under various conditions. [This blog post I found](http://tronixstuff.com/2011/06/22/tutorial-arduino-timing-methods-with-millis/) has an example code that shows how to do something like that.

-Nathan
