Assume you have a presentation and you want it to stay on the screen for 10 seconds, you may write code something like
pause(10)
or WaitSecs(10)
It’s fine except you can do nothing within those 10s. What if you want to do something else during the 10s (e.g check if subject pressed a button, or check if the scanner emits some signal)? In this case you should not use pause
or WaitSecs
, but instead use a while loop:
startTime = GetSecs; while(GetSecs - startTime < 10) ... check keyboard input etc end
Receive email notification via email 博客有新内容通知我
Don't want to miss new papers in your field? Check out Stork we developed: ![]() |
专注医学生物类的论文润色 联系他们请用优惠码 STORK4,他们会给你折扣。 |