473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

system.timer not firing

I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...

Nov 16 '05 #1
5 5979
-----Original Message-----
I have a simple Windows Service with a timer (system.timer).The service seems to run just fine when I have the Timer = 1 minute, butwhen I set the Timer = 15 minutes it only fires once ... then appears tostop.

any help is greatly appreciated...


Check the doc's, I've not had to play with timers for a
bit now, but I think there is a maximum time that a timer
can do, then you have to keep track of how many times it
fires for running total until you reach your max value.
Nov 16 '05 #2
yes, this appears to be the case. i didn't find any mention in the
System.Timer docs on MSDN concerning a maximum range for a timer, but
through trial and error this appears to be true...
thanks for the help...

"morgal" <vb**********@yahoo.com> wrote in message
news:24*****************************@phx.gbl...
-----Original Message-----
I have a simple Windows Service with a timer

(system.timer).
The service seems to run just fine when I have the Timer

= 1 minute, but
when I set the Timer = 15 minutes it only fires once ...

then appears to
stop.

any help is greatly appreciated...


Check the doc's, I've not had to play with timers for a
bit now, but I think there is a maximum time that a timer
can do, then you have to keep track of how many times it
fires for running total until you reach your max value.

Nov 16 '05 #3
No it's working here just fine, with the Interval set
to 5 mins. Check whether your logic is ok, especially the Interval
setting logic, and whether you're setting AutoReset to false
(should be true, the default), and whether it's getting disabled
somehow, and whether Elapsed is hooked properly.

RayO
"Pedro Gonçalves" <Pedro Go******@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
Hi Caulker,

It seams to be a bug in Timer. Just see my post 'Bug in timers.timer ?'.

Pedro Gonçalves

"caulker" wrote:
I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...

Nov 16 '05 #4
Pedro Gonçalves wrote:
Hi Caulker,

It seams to be a bug in Timer. Just see my post 'Bug in timers.timer ?'.

Pedro Gonçalves

"caulker" wrote:

I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...

The System.Timer is not really suitable for services somehow.
You can't count on System.Timer, use the Timer from the
System.Threading.Timer:
http://msdn.microsoft.com/library/en...classtopic.asp

There's another article somwhere on MSDN that comnpares the different
type of Timer objects. Can't find it anymore.

//Rutger
Nov 16 '05 #5
There are actually three of them. The least reliable is
the Windows one, which I don't use.

I'm using the Timers one, which works just fine, and is
more accurate and reliable than the Windows one.

There is also the Threading one, which is more lightweight
and has fewer features, and may be even more reliable.

RayO

"Rutger" <ru********@hotmail.com> wrote in message
news:41***********************@news.xs4all.nl...
Pedro Gonçalves wrote:
Hi Caulker,

It seams to be a bug in Timer. Just see my post 'Bug in timers.timer ?'.

Pedro Gonçalves

"caulker" wrote:

I have a simple Windows Service with a timer (system.timer).
The service seems to run just fine when I have the Timer = 1 minute, but
when I set the Timer = 15 minutes it only fires once ... then appears to
stop.

any help is greatly appreciated...


The System.Timer is not really suitable for services somehow.
You can't count on System.Timer, use the Timer from the
System.Threading.Timer:

http://msdn.microsoft.com/library/en...classtopic.asp
There's another article somwhere on MSDN that comnpares the different
type of Timer objects. Can't find it anymore.

//Rutger

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
3
by: ELO | last post by:
Hi all Every week, I need to get two files on a remote server. I have developped a C# Windows Service with two System.Threading.Timer to do this task For the first one, the delay (TimeSpan...
2
by: linesh.gajera | last post by:
Hi Guys, I am creating a Windows service that call a routine at given interval. Once routine is complete, windows service should wait for 5 minutes and then call the routine again. I was using...
1
by: james.e.coleman | last post by:
Hello, System.Timers.Timer/System.Threading.Timer do not fire on my development server, yet they work perfectly on the production server. I would appreciate any help on what the cause of this...
4
by: Liverpool fan | last post by:
I have a windows application written using VB .NET that encompasses a countdown timer modal dialog. The timer is a System.Timers.Timer with an interval of 1 second. AutoReset is not set so accepts...
2
by: jajalc | last post by:
Hi all, WE have a windows service using .net and which uses a System.Timers.Timer..all the of code works fine..... but after a extended period of time the timer just stops firing the elasped...
7
by: RobKinney1 | last post by:
Hello, Wow...I have one for you all and hopefully I am not understanding this timer object correctly. I have a timer setup that pulses a connection through a socket every 60 seconds. But it...
9
by: archana | last post by:
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is...
4
by: Max | last post by:
This may be an elementary question but it's something I have not encountered in about 10 years writing code in VB 5 / 6 I have a timer that using the API checks if there has been a change to one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.