Community
cancel
Showing results for 
Search instead for 
Did you mean: 
BWill15
New Contributor II
1,359 Views

Accuracy of time.sleep() in Python on the Intel Galileo Gen 2

What is the accuracy of time.sleep() (or the time library in general) in Python on the Intel Galileo Gen 2?

Relevant: http://stackoverflow.com/questions/1133857/how-accurate-is-pythons-time-sleep http://stackoverflow.com/questions/1133857/how-accurate-is-pythons-time-sleep

Tags (1)
4 Replies
idata
Community Manager
85 Views

Hi BrechtW,

 

 

As it is said in the StackOverFlow thread that you shared, this feature is dependent on the OS being used so it would be necessary to do some research on the Yocto specifications regarding the sleep accuracy. If we take some other Linux distributions as a reference point, the timer.sleep function accuracy should be of about 1ms-10ms (mininum). However, given that Yocto is not a standard distribution this might change a little bit, I would suggest you to check the Yocto documentation to see if you can find accurate data about this time.

 

 

Regards,

 

Pablo
BWill15
New Contributor II
85 Views

There doesn't seem to be information on that in this manual: http://www.yoctoproject.org/docs/1.8/mega-manual/mega-manual.html Yocto Project Mega-Manual.

idata
Community Manager
85 Views

Hi BrechtW,

 

 

Let me investigate this a little bit more, I also did some research on the Yocto Mega Manual and didn't find anything. I'll get back to you once we have an answer.

 

 

Regards,

 

Pablo
idata
Community Manager
85 Views

Hi BrechtW,

Thank you for your patience. We've tested the example suggested in http://stackoverflow.com/questions/1133857/how-accurate-is-pythons-time-sleep http://stackoverflow.com/questions/1133857/how-accurate-is-pythons-time-sleep to measure the average error.

 

In a NUC with Ubuntu 14.04 LST we got an average error in 0.16ms, using the Galileo with the eglibc image we got an average error of 0.40ms and with the uclibc 0.32ms.

 

These differences are due to the processes and utilization of the processor that is why it changes from one system to another.

Regards,

 

-Pablo
Reply