'Arduino millis() in Python

Is there a function like millis() from Arduino IDE in Python? I tried to manipulate date and time stuff in python but can't find or get anything close to the millis() function from Arduino.



Solution 1:[1]

micropython millis

Try to type: import utime utime. then press Tab. Useful link: https://docs.micropython.org/en/latest/library/utime.html

Solution 2:[2]

start = pyb.millis()
while pyb.elapsed_millis(start) < 1000:
    # Perform some operation

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hadj messaoud
Solution 2 Oscar Lluch Serrat