Lapse in Window Service
-
Hi, Recently I have launched a service and it is working fine. The problem now is it lapses a second for every 2 days. :sigh: Is there any workaround to solve this. Can any one advise me on this.
Long Live
-
Hi, Recently I have launched a service and it is working fine. The problem now is it lapses a second for every 2 days. :sigh: Is there any workaround to solve this. Can any one advise me on this.
Long Live
What do you mean? What lapses a second? What processing is going on? Without this information, I wouldn't even begin to know where to look.
Deja View - the feeling that you've seen this post before.
-
Hi, Recently I have launched a service and it is working fine. The problem now is it lapses a second for every 2 days. :sigh: Is there any workaround to solve this. Can any one advise me on this.
Long Live
Hi thanks for you reply. The service generates a file on a daily basis at a specified time range mentioned in the app config file. For this purpose the service will make a check the current time against the one in config file for every 5 mins. This part works fine. The problem is for example if it check by 12:34:33 pm the next check is performed exactly at 12:39:33 PM. But in course of time say a day or two the checking drifts from 12:34:33 PM to 12:34:34 PM. Like this with in a month the polling time chages to 12:35:XX PM. I wish to put a check on this. B'coz if the file generation time range is between 12:33:00 PM 12:36:00 PM in course of time the service may run without generating the file. Thanx and Rgds,
Long Live
-
Hi thanks for you reply. The service generates a file on a daily basis at a specified time range mentioned in the app config file. For this purpose the service will make a check the current time against the one in config file for every 5 mins. This part works fine. The problem is for example if it check by 12:34:33 pm the next check is performed exactly at 12:39:33 PM. But in course of time say a day or two the checking drifts from 12:34:33 PM to 12:34:34 PM. Like this with in a month the polling time chages to 12:35:XX PM. I wish to put a check on this. B'coz if the file generation time range is between 12:33:00 PM 12:36:00 PM in course of time the service may run without generating the file. Thanx and Rgds,
Long Live
Without looking at the code, how do you expect us to help you? *If* you are using Thread.Sleep(5 * 1000), then it will not be correct because the actual processing work takes up some time. Use a
Timer
instead.Cheers, Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
-
Hi thanks for you reply. The service generates a file on a daily basis at a specified time range mentioned in the app config file. For this purpose the service will make a check the current time against the one in config file for every 5 mins. This part works fine. The problem is for example if it check by 12:34:33 pm the next check is performed exactly at 12:39:33 PM. But in course of time say a day or two the checking drifts from 12:34:33 PM to 12:34:34 PM. Like this with in a month the polling time chages to 12:35:XX PM. I wish to put a check on this. B'coz if the file generation time range is between 12:33:00 PM 12:36:00 PM in course of time the service may run without generating the file. Thanx and Rgds,
Long Live
I suspect that what you are seeing is simply the result of an operation taking time to complete, and the timer that is doing the polling is gradually slipping as a result.
Deja View - the feeling that you've seen this post before.
-
I suspect that what you are seeing is simply the result of an operation taking time to complete, and the timer that is doing the polling is gradually slipping as a result.
Deja View - the feeling that you've seen this post before.
This is how i coded. lDueTime = 60000; lPeriod = 300000; TimerCallback timerDelegate = new TimerCallback(FileOperations); ThreadTimer = new Timer(timerDelegate, null, lDueTime, lPeriod); public void FileOperations() { // My code goes here }
Long Live