How to make my timer tick as fast as system clock?

Hi to the community,

Trying some other alternatives, I finally managed my aim. A countdown code to display time allowing intermediate start/stop intervals. It might be useful to @yulius or anyone else.

Please note the following:

  1. Normally min:sec is displayed. When time left is less than 1s, then sec:hundreds is shown.
  2. It is for demontration purposes to quickly reach 60s. So var PeriodTime is set to 2 min. Set it accordingly (eg 600000 for a basketball period).
  3. A strPadL procedure is used to display single digit seconds as zero-preceded (like 09).
  4. In the part else if global TimeLeft < 0 a correction display set Label2.Text to 0:00 is added, since sometimes a few hundreds of sec remain in time counting after execution.

I upload both blocks and aia.


test_3.aia (37.1 KB)

5 Likes