I try to composite the Reaction time test app. I used the clock timer with timeintervals for 1. It seem works while it running but I found it had a big problem: time lag.
How could I do to correct this problem! The blocks were shown as attachment. 截圖 2021-10-28 下午12.21.00|690x356Reaction_time.aia (4.6 KB)
There will always be some lag in the Clock component. You might want to try the suggestions in this topic:
2 Likes
The trick here is not to try to show every millisecond.
Instead, use a global variable with Clock.SystemTime for the moment the red appears, and show the difference between current Clock.SystemTime and the saved SystemTime.
The app:
(Components renamed for my sanity)
Reaction_time_ABG.aia (4.1 KB)Details:
![global startMS](https://community.appinventor.mit.edu/uploads/default/original/3X/7/6/762330b11173222cd21662bdfb461d62a737b36a.png)
![when btnReset Click](https://community.appinventor.mit.edu/uploads/default/original/3X/6/3/635e09c00f364e78ef1c0a96a294d185526a9d46.png)
![when clk_wait_for_red Timer](https://community.appinventor.mit.edu/uploads/default/original/3X/7/f/7f161bcf4d6559b285aca39f017dcdfb9dee2b68.png)
![when Screen1 Initialize](https://community.appinventor.mit.edu/uploads/default/original/3X/2/f/2f79cbcba28a7527d6dfe0e8d2b8411b801be515.png)
2 Likes
Thank you so much and appreciated what you have done. You really did me a favors. As you mentioned, the most important is to calculate the difference of time-points from system not the Clock timer. Thank you again!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.