C# Console Application - Keep it running

前端 未结 11 1767
萌比男神i
萌比男神i 2020-12-16 01:02

I am about to develop a console application that will be required to continually run and carry out work at specific times.

My question is what is are best methods or

11条回答
  •  情深已故
    2020-12-16 01:44

    If your program is going to be continually running then you should sleep until the desired event occurs (e.g. XX seconds passes). If you just spin in a while {} loop you'll suck up CPU times.

    If your program is going to always be running on a machine then you should consider making it a service so it automatically starts and stops with the machine.

提交回复
热议问题