This shows the behavior which occurs near max resolution:
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> import time
>>> t1 = time.monotonic(); time.sleep(0.1); t2 = time.monotonic(); t2-t1
0.0991211
>>> t1 = time.monotonic(); time.sleep(0.01); t2 = time.monotonic(); t2-t1
0.00878906
>>> t1 = time.monotonic(); time.sleep(0.001); t2 = time.monotonic(); t2-t1
0.0
>>>
And some key bits of code are here:
https://github.com/adafruit/circuitpython/blob/master/shared-bindings/time/__init__.c#L76
which calls here:
https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/time/__init__.c#L37
with an implicit cast from float to uint32_t occurring in the process which results in the truncation.
This shows the behavior which occurs near max resolution:
And some key bits of code are here:
https://github.com/adafruit/circuitpython/blob/master/shared-bindings/time/__init__.c#L76
which calls here:
https://github.com/adafruit/circuitpython/blob/master/ports/atmel-samd/common-hal/time/__init__.c#L37
with an implicit cast from
floattouint32_toccurring in the process which results in the truncation.