The realization of C-sharp countdown function.

Overview of requirements

perform the countdown task according to the remaining time obtained.

  1. there should be a label dynamic display of remaining time in the form
  2. perform operations when there are only 20 seconds left. All the time is over and proceed to operations 2

the remaining time is not fixed. The remaining time is obtained dynamically. The format is 08:12:30, hours: minutes: seconds. As above, the remaining time is 8 hours, 12 minutes: 30 seconds; no more than 12 hours.

I only consult the countdown part, dynamic acquisition of the remaining time has been completed.

since the software runs continuously according to the remaining time, it may be 10 hours or a few minutes, so you want the countdown to perform the task accurately as much as possible.

PS: I don"t understand C-sharp at all, PHP rookie, so please be as detailed as possible, thank you very much.

Apr.20,2022

simple can use Timer
complex can use third-party components: hangfire, Quartz.net

Menu