Guys, I developed a Windows service in C # and you need time to start (60-70 seconds). I was wondering if this usually takes so long, or is this my code that takes a lot of time. I have two threads that run every 6 seconds and 1 minute.
And if it takes a long time, can someone tell me why it takes a long time. Not in details just a review.
If your service runs a lot during startup ( service.OnStart), it will take a long time.
service.OnStart
Postpone work to another thread if you want to start the service immediately.
, .
,
protected override void OnStart(string [] args) { System.Threading.Thread workerThread =new System.Threading.Thread(longprocess()); workerThread.start(); } private void longprocess() { ///long stuff }
, , longprocess() .
Source: https://habr.com/ru/post/1728647/More articles:INotifyPropertyChanged: AoP or IoC / DI? - c #Where should the TClientDataset be located? - delphiASP.Net MVC application on Windows Server 2008 uses a static file handler - installationInheritance and .NET Interfaces - c #Поддержание HTTP-ссылки - redirectmono obfuscator for non-window os - c #ASP.NET MVC Authorization Settings - securityAndroid SDK error after creating emulator - androidbash script date / time of execution - datejavac compile error - "... abstract, cannot be an instance" - javaAll Articles