logo

两个延时函数的区别?

2021-07-10 21:58
I
nlsd

time.sleep_ms()和pyb.delay()这两个函数有啥区别呢?在运行下面这个实时时钟的时候感觉这两个函数没有什么不同。

import time, pyb
from pyb import RTC

rtc = RTC()
rtc.datetime((2013, 7, 9, 2, 0, 0, 0, 0))

while (True):
    print(rtc.datetime())
    time.sleep_ms(1000)
    #pyb.delay(1000)
2021-07-12 20:19
I
网红小智智 星瞳科技

没有区别。:grinning_face_with_smiling_eyes: