473,508 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timer fires a few milliseconds before the actual Due-Time

HL
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired a few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005 Beta?
Nov 17 '05 #1
9 7246
Hi,

First of all you will NEVER get the event executed exactly as you
especified, winXX is not a real time OS so what is done when the time to
execute the timer is simply generate an event, the handler will be executed
in a thread frm the threadpool.
As you can imagine all this actions take time.

With that said the comparision if ( Current Time - m_dtCurrrentTime) will
never be exact.
And really don't see the point of the comparision, after all you are calling
this from a timer, what is the point to check the timer elapsed time ?
Why are you calling Change twice , there is where your problem may be.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired a
few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails
and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005 Beta?

Nov 17 '05 #2
I have also seen this problem and I haven't found an explanation.

See in-line comments:

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OR**************@tk2msftngp13.phx.gbl...
Hi,

First of all you will NEVER get the event executed exactly as you
especified, winXX is not a real time OS so what is done when the time to
execute the timer is simply generate an event, the handler will be
executed in a thread frm the threadpool.
As you can imagine all this actions take time.

We realize that Windows isn't a real time OS, I would understand if the
timer went off a few milliseconds too late or even seconds late but, the
problem is it's going off too soon. If I set a timer to go off 50,000
milliseconds from now, why would it go off 49,998 milliseconds from now?
The only explanation that I can think of it that the Windows Time service
adjusts the time forward a few milliseconds but that doesn't affect when
timers we fire. That's just a guess.

With that said the comparision if ( Current Time - m_dtCurrrentTime) will
never be exact.
And really don't see the point of the comparision, after all you are
calling this from a timer, what is the point to check the timer elapsed
time ?
In our case, we have a collection of things that have to happen at specific
times. We walk through that collection and find the nearest time and then
calculate the number of milliseconds between now and the items action time.
Then we set a timer to go off in that number of milliseconds. When the
timer goes off, we walk through the list again expecting to find at least
one item with an action time that has past but, sometimes we don't because
the timer went off a few milliseconds too soon.

In our case, it just means that we reset the time for just a few
milliseconds but I would still like to know what's going on.
John Vottero


Why are you calling Change twice , there is where your problem may be.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set
the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired a
few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails
and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005 Beta?


Nov 17 '05 #3
why don't you use a thread instead that runs constantly Sleep(0-1) and
distributes tasks as the come to be? Its the most precise way to do it and
is only a tick more difficult...

"John Vottero" <Jo**@mvpsi.com> schrieb im Newsbeitrag
news:uT**************@TK2MSFTNGP09.phx.gbl...
I have also seen this problem and I haven't found an explanation.

See in-line comments:

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:OR**************@tk2msftngp13.phx.gbl...
Hi,

First of all you will NEVER get the event executed exactly as you
especified, winXX is not a real time OS so what is done when the time to
execute the timer is simply generate an event, the handler will be
executed in a thread frm the threadpool.
As you can imagine all this actions take time.

We realize that Windows isn't a real time OS, I would understand if the
timer went off a few milliseconds too late or even seconds late but, the
problem is it's going off too soon. If I set a timer to go off 50,000
milliseconds from now, why would it go off 49,998 milliseconds from now?
The only explanation that I can think of it that the Windows Time service
adjusts the time forward a few milliseconds but that doesn't affect when
timers we fire. That's just a guess.

With that said the comparision if ( Current Time - m_dtCurrrentTime)
will never be exact.
And really don't see the point of the comparision, after all you are
calling this from a timer, what is the point to check the timer elapsed
time ?


In our case, we have a collection of things that have to happen at
specific times. We walk through that collection and find the nearest time
and then calculate the number of milliseconds between now and the items
action time. Then we set a timer to go off in that number of milliseconds.
When the timer goes off, we walk through the list again expecting to find
at least one item with an action time that has past but, sometimes we
don't because the timer went off a few milliseconds too soon.

In our case, it just means that we reset the time for just a few
milliseconds but I would still like to know what's going on.
John Vottero


Why are you calling Change twice , there is where your problem may be.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set
the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired
a few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails
and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005 Beta?



Nov 17 '05 #4
"Robert Heuvel" <ro***********@isopass.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
why don't you use a thread instead that runs constantly Sleep(0-1) and
distributes tasks as the come to be? Its the most precise way to do it and
is only a tick more difficult...
I don't see why that would solve the problem. If I calculate the number of
milliseconds until 1:00:00.0000 and do a Sleep(thatNumber) I could still
wake from the sleep to find that it's 12:59:59.9773.

"John Vottero" <Jo**@mvpsi.com> schrieb im Newsbeitrag
news:uT**************@TK2MSFTNGP09.phx.gbl...
I have also seen this problem and I haven't found an explanation.

See in-line comments:

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:OR**************@tk2msftngp13.phx.gbl...
Hi,

First of all you will NEVER get the event executed exactly as you
especified, winXX is not a real time OS so what is done when the time to
execute the timer is simply generate an event, the handler will be
executed in a thread frm the threadpool.
As you can imagine all this actions take time.

We realize that Windows isn't a real time OS, I would understand if the
timer went off a few milliseconds too late or even seconds late but, the
problem is it's going off too soon. If I set a timer to go off 50,000
milliseconds from now, why would it go off 49,998 milliseconds from now?
The only explanation that I can think of it that the Windows Time service
adjusts the time forward a few milliseconds but that doesn't affect when
timers we fire. That's just a guess.

With that said the comparision if ( Current Time - m_dtCurrrentTime)
will never be exact.
And really don't see the point of the comparision, after all you are
calling this from a timer, what is the point to check the timer elapsed
time ?


In our case, we have a collection of things that have to happen at
specific times. We walk through that collection and find the nearest
time and then calculate the number of milliseconds between now and the
items action time. Then we set a timer to go off in that number of
milliseconds. When the timer goes off, we walk through the list again
expecting to find at least one item with an action time that has past
but, sometimes we don't because the timer went off a few milliseconds too
soon.

In our case, it just means that we reset the time for just a few
milliseconds but I would still like to know what's going on.
John Vottero


Why are you calling Change twice , there is where your problem may be.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set
the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired
a few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails
and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005
Beta?



Nov 17 '05 #5
HL
Hi,

Well, regarding the Change event being called twice: After the timer is
fired, it is disabled. Subsequently, On receiving a message in the WndProc of
the Form, I would like to enable the timer. Hence the Change event is called
twice - once to disable the timer and the next time to enable it.

I can understand if the timer fires a millisconds later than the actual
time. But the problem is that it fires a few milliseconds before the actual
time. Anybody to help out?

Thanks.

"John Vottero" wrote:
"Robert Heuvel" <ro***********@isopass.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
why don't you use a thread instead that runs constantly Sleep(0-1) and
distributes tasks as the come to be? Its the most precise way to do it and
is only a tick more difficult...


I don't see why that would solve the problem. If I calculate the number of
milliseconds until 1:00:00.0000 and do a Sleep(thatNumber) I could still
wake from the sleep to find that it's 12:59:59.9773.

"John Vottero" <Jo**@mvpsi.com> schrieb im Newsbeitrag
news:uT**************@TK2MSFTNGP09.phx.gbl...
I have also seen this problem and I haven't found an explanation.

See in-line comments:

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:OR**************@tk2msftngp13.phx.gbl...
Hi,

First of all you will NEVER get the event executed exactly as you
especified, winXX is not a real time OS so what is done when the time to
execute the timer is simply generate an event, the handler will be
executed in a thread frm the threadpool.
As you can imagine all this actions take time.
We realize that Windows isn't a real time OS, I would understand if the
timer went off a few milliseconds too late or even seconds late but, the
problem is it's going off too soon. If I set a timer to go off 50,000
milliseconds from now, why would it go off 49,998 milliseconds from now?
The only explanation that I can think of it that the Windows Time service
adjusts the time forward a few milliseconds but that doesn't affect when
timers we fire. That's just a guess.
With that said the comparision if ( Current Time - m_dtCurrrentTime)
will never be exact.
And really don't see the point of the comparision, after all you are
calling this from a timer, what is the point to check the timer elapsed
time ?

In our case, we have a collection of things that have to happen at
specific times. We walk through that collection and find the nearest
time and then calculate the number of milliseconds between now and the
items action time. Then we set a timer to go off in that number of
milliseconds. When the timer goes off, we walk through the list again
expecting to find at least one item with an action time that has past
but, sometimes we don't because the timer went off a few milliseconds too
soon.

In our case, it just means that we reset the time for just a few
milliseconds but I would still like to know what's going on.
John Vottero

Why are you calling Change twice , there is where your problem may be.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
>I am using VS 2005 Beta - C#
>
> Problem: The Timer fires a few milliseconds before the actual Due-Time
>
> Let's say a timer is created in the following manner:
> System.Threading.Timer m_timer = null;
>
> Let's declare a constant
> Int32 m_TimePeriod = 10000;
>
>
> In the Initialize method:
> m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
> m_timer.Change(m_TimePeriod, 0);
>
>
> In WndProc of Form:
> Get the current time and store in m_dtCurrentTime
>
> // Change the Due-Time and Period to enable the timer
> m_timer.Change(m_TimePeriod, 0);
>
>
> In the XXXTimerProc:
> Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
> {
> // Perform some action
>
> ::
> ::
>
> // Change the Due-Time and Period to disable the timer
> m_timer.Change(System.Threading.Timeout.Infinite,
> System.Threading.Timeout.Infinite);
> }
>
>
> In the WndProc of the Form, the Timer's Change method is called to set
> the
> DueTime to m_TimePeriod. This enables the timer. But the Timer is fired
> a few
> milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
> condition for checking the difference between the DateTime values fails
> and
> the neccesary actions do not take place.
>
> Is there something wrong that I am doing or Is it a bug in VS 2005
> Beta?
>
>



Nov 17 '05 #6

"HL" <HL@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.com...
I am using VS 2005 Beta - C#

Problem: The Timer fires a few milliseconds before the actual Due-Time

Let's say a timer is created in the following manner:
System.Threading.Timer m_timer = null;

Let's declare a constant
Int32 m_TimePeriod = 10000;
In the Initialize method:
m_timer = new System.Threading.Timer(new TimerCallback(XXXTimerProc));
m_timer.Change(m_TimePeriod, 0);
In WndProc of Form:
Get the current time and store in m_dtCurrentTime

// Change the Due-Time and Period to enable the timer
m_timer.Change(m_TimePeriod, 0);
In the XXXTimerProc:
Check if ( Current Time - m_dtCurrrentTime) >= m_TimePeriod
{
// Perform some action

::
::

// Change the Due-Time and Period to disable the timer
m_timer.Change(System.Threading.Timeout.Infinite,
System.Threading.Timeout.Infinite);
}
In the WndProc of the Form, the Timer's Change method is called to set the
DueTime to m_TimePeriod. This enables the timer. But the Timer is fired a
few
milliseconds before m_TimePeriod. As a result, In the XXXTimerProc, the
condition for checking the difference between the DateTime values fails
and
the neccesary actions do not take place.

Is there something wrong that I am doing or Is it a bug in VS 2005 Beta?

All timers in the Framework are using the System clock as timer source, this
clock has a (system wide default) resolution of x milliseconds (where x is
10 msec. on most X86 based hardware) - that means that the clock changes
(fires) every x (10) msec.
Say you initialize a timer to fire after 10 seconds, and say this happens 2
msec. after the last system clock tick, that means that the timer counts
10000 ticks before it fires, that is after 8 msec. (to the first tick) +
9999 * 10 msec = 9999.8 msec.
When you initialize the timer, your current system time is the time of the
system clock at the last tick, that is the timer initialization time - 2
msec, lets call it t1. When the timer fires the current time is the same as
the time of the system clock, that is 10000 clock ticks after t1 or exactly
10000 msec. That means that your timer interval will always be up to x - 1
msec. less than the wanted interval.
What you could do to solve your problem (though I don't get why you are
doing this) is correct the start time by adding the clock interval to the
start time t1 (your m_dtCurrentTime).

Willy.

Nov 17 '05 #7
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:uS**************@TK2MSFTNGP15.phx.gbl...
[snip]
All timers in the Framework are using the System clock as timer source,
this clock has a (system wide default) resolution of x milliseconds (where
x is 10 msec. on most X86 based hardware) - that means that the clock
changes (fires) every x (10) msec.
Say you initialize a timer to fire after 10 seconds, and say this happens
2 msec. after the last system clock tick, that means that the timer counts
10000 ticks before it fires, that is after 8 msec. (to the first tick) +
9999 * 10 msec = 9999.8 msec.
When you initialize the timer, your current system time is the time of the
system clock at the last tick, that is the timer initialization time - 2
msec, lets call it t1. When the timer fires the current time is the same
as the time of the system clock, that is 10000 clock ticks after t1 or
exactly 10000 msec. That means that your timer interval will always be up
to x - 1 msec. less than the wanted interval.
What you could do to solve your problem (though I don't get why you are
doing this) is correct the start time by adding the clock interval to the
start time t1 (your m_dtCurrentTime).


Thanks. Is there a way to get the clock interval? Is it a fairly safe bet
that the clock interval will always be <= 10ms?

Nov 17 '05 #8

"John Vottero" <Jo**@mvpsi.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:uS**************@TK2MSFTNGP15.phx.gbl...

[snip]

All timers in the Framework are using the System clock as timer source,
this clock has a (system wide default) resolution of x milliseconds
(where x is 10 msec. on most X86 based hardware) - that means that the
clock changes (fires) every x (10) msec.
Say you initialize a timer to fire after 10 seconds, and say this happens
2 msec. after the last system clock tick, that means that the timer
counts 10000 ticks before it fires, that is after 8 msec. (to the first
tick) + 9999 * 10 msec = 9999.8 msec.
When you initialize the timer, your current system time is the time of
the system clock at the last tick, that is the timer initialization
time - 2 msec, lets call it t1. When the timer fires the current time is
the same as the time of the system clock, that is 10000 clock ticks after
t1 or exactly 10000 msec. That means that your timer interval will always
be up to x - 1 msec. less than the wanted interval.
What you could do to solve your problem (though I don't get why you are
doing this) is correct the start time by adding the clock interval to the
start time t1 (your m_dtCurrentTime).


Thanks. Is there a way to get the clock interval? Is it a fairly safe
bet that the clock interval will always be <= 10ms?


Yep, using PInvoke...

[DllImport("kernel32.dll")]
extern static int GetSystemTimeAdjustment(out uint lpTimeAdjustment,
out uint lpTimeIncrement, out bool lpTimeAdjustmentDisabled);

....
GetSystemTimeAdjustment(out adjustment,
out clockInterval,
out adjustmentDisabled );

clockInterval returns the clock interval in 100 nsec. units. Divide this
number by 1000 to get the msec. timer interval.

Willy.
Nov 17 '05 #9
HL
Thanks Willy. The solution was very nicely explained.

"Willy Denoyette [MVP]" wrote:

"John Vottero" <Jo**@mvpsi.com> wrote in message
news:OP**************@TK2MSFTNGP12.phx.gbl...
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:uS**************@TK2MSFTNGP15.phx.gbl...

[snip]

All timers in the Framework are using the System clock as timer source,
this clock has a (system wide default) resolution of x milliseconds
(where x is 10 msec. on most X86 based hardware) - that means that the
clock changes (fires) every x (10) msec.
Say you initialize a timer to fire after 10 seconds, and say this happens
2 msec. after the last system clock tick, that means that the timer
counts 10000 ticks before it fires, that is after 8 msec. (to the first
tick) + 9999 * 10 msec = 9999.8 msec.
When you initialize the timer, your current system time is the time of
the system clock at the last tick, that is the timer initialization
time - 2 msec, lets call it t1. When the timer fires the current time is
the same as the time of the system clock, that is 10000 clock ticks after
t1 or exactly 10000 msec. That means that your timer interval will always
be up to x - 1 msec. less than the wanted interval.
What you could do to solve your problem (though I don't get why you are
doing this) is correct the start time by adding the clock interval to the
start time t1 (your m_dtCurrentTime).


Thanks. Is there a way to get the clock interval? Is it a fairly safe
bet that the clock interval will always be <= 10ms?


Yep, using PInvoke...

[DllImport("kernel32.dll")]
extern static int GetSystemTimeAdjustment(out uint lpTimeAdjustment,
out uint lpTimeIncrement, out bool lpTimeAdjustmentDisabled);

....
GetSystemTimeAdjustment(out adjustment,
out clockInterval,
out adjustmentDisabled );

clockInterval returns the clock interval in 100 nsec. units. Divide this
number by 1000 to get the msec. timer interval.

Willy.

Nov 17 '05 #10

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

Similar topics

3
1845
by: David | last post by:
Hi There! I'm using Timer control to record how long my application perform certain tasks. However, apparently Timer control is not doing its' job (i.e. Not firing Tick event) while my...
2
4554
by: Ryan Moore | last post by:
is there any way to get a more accurate version of the timer? Basically what I need it to do something every 33 milliseconds, but for some reason, setting the timer.Interval=33 does not ensure that...
6
2836
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
6
6117
by: whtinkm | last post by:
Hi, All Recently, my project need some code like following: using System; using System.Threading; namespace MyTimerTest { class Class1 {
6
2035
by: Antti Laakso | last post by:
Hi i have function like above Public Sub halytystutkinta() Dim ds As New DataSet ds = dl2.HaeHalytys() Dim onkohal As Int16 onkohal = ds.Tables(0).Rows(0).Item("onkohalytys") halid =...
5
2172
by: csgraham74 | last post by:
HI all, I want to implement this scenario: I need my ASP.NET website to check a SQL table every 30 seconds and if there is a change to display a message to user. I have created a panel control...
2
304
by: Myo Zaw | last post by:
hi, i have a windows service which is checking to the desire URL and check back its httpwebresponse data. and, i save the result in a log file insdie local drive. i use a timer to trigger my...
8
1518
by: TheMadHatter | last post by:
Yello, Quick Q: I created a windows service that changes some data every (approx) 1sec, but currently it is using a loop on a separate thread that uses Thread.Sleep(1000). Is that bad...
10
4248
by: igor | last post by:
I have recently discovered that the system.Timers.Timer from.Net Framework v1.1 is not reliable when used on Windows 2003 server. When incorporated into a Windows Service, the timer_elapsed event...
8
2636
by: =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post by:
I have a Timer that I set to go off once a day, but it frequently fails! In order to debug I would like to be able to check, at any moment, whether the Timer is enabled and when it will next...
0
7123
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
7324
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
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7042
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
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.