Pico MicroPython's time() does not include fractions, and the fractions from ticks_*() are not synchronized with the moments that the integer time increments. So I think you need to use time_ns() to calculate a sleep to the next whole second:
Code:
import utimewhile True: utime.sleep_us(1000000 - utime.time_ns()//1000 % 1000000) print(utime.time_ns())
Statistics: Posted by jojopi — Wed Apr 10, 2024 8:54 pm