[RTL8722CSM] [RTL8722DM] Time - Delay and Timing


  • AmebaD[AMB21 / AMB22] x 1


MicroPython has provided rich functions to deal with time and delay, here are some examples.

Copy and paste the following code line by line into REPL to see its effect.

1import time
2time.sleep(1) # sleep for 1 second
3time.sleep_ms(500) # sleep for 500 milliseconds
4time.sleep_us(10) # sleep for 10 microseconds
5start = time.ticks_ms() # get millisecond counter