There will usually be some work on timed tasks, such as counting the number of XXX users per minute or timing pulling down data.
It is common to implement scheduled scheduling functions and control whether threads can execute concurrently.
So usually a simple small project becomes a big project, but using Fluentscheduler will be much better
Project Link Https://github.com/fluentscheduler/FluentScheduler
For example I need a task run once per second if not run out next time do not perform:
public static void Main (string[] args) {//console.writeline ("Hello world!"); Jobmanager.addjob (() = new Testservice (). xxxx (), (s) = S.nonreentrant (). Torunevery (1). Seconds ()); Console.ReadLine ();}
Or I need a mission to run at 9 every day.
public static void Main (string[] args) {//console.writeline ("Hello world!"); Jobmanager.addjob (() = new Testservice (). xxxx (), (s) = S.nonreentrant (). Torunevery (1). Days (). at (9,0)); Console.ReadLine ();}
Lazy implementation of C # timed tasks