time.time() :
Return the time in seconds since the epoch as a floating point number. Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.
I want to ask about the function of time.time()
when used on Raspberry Pi. I am working on a code where I have to organize a system with a perfect timing [ e.g, do something exactly every 5 seconds, not a second more or less! For ever!]. However, I noticed that the second increments when the decimal value of time.time()
is somewhere between .95-.05, instead of incrementing when the decimal value is .00
Example: if the time 1439286302.64, then according to the decimal values, it will increment by 1 second when it reaches ~1439286302.9x. Does anyone know what's the exact boundary at which it will increment by 1 second? Because I have been testing and this seems to be random, and I couldn't find an answer online.
I appreciate all help.