ArceOS 中实现一个延迟 n 秒的功能 #15
limingth
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
通过 fibonacci_recursive 这个递归函数实现了 1 秒左右的延迟,通过 delay 传参数,并在函数里打印读秒,可以实现 n 秒延迟。
尝试过多重循环的方法,发现可能编译器有优化,在 qemu 里没有看出来有明显延迟的效果,遂改成用 fibonacci_recursive 来实现。
All reactions