Timer2 seems slow

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a timer set to enable on a button click action. All of that works
fine, it displays on Label3 on Form1. Here is the thing though. Interval =
3000, which should be roughly 30 minutes (if my calculations are correct.)
The counter seems to be counting in seconds, which is fine, but for every
tick of the counter, 2-3 seconds pass on the system clock. Is there any way
to make the timer tick ACTUAL seconds? Or minutes better yet?
Code as follows so far:

Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolStripButton2.Click
If ToolStripButton2.Pressed Then Timer2.Enabled = True
End Su
--------------------------------------------------------------------------------
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer2.Tick
Static TimeSeconds As DateInterval = 3000
TimeSeconds = TimeSeconds - 1
Label3.Text = TimeSeconds
End Su
--------------------------------------------------------------------------------
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolStripButton4.Click
If ToolStripButton4.Pressed = True Then Timer2.Stop()
End Sub
--
<XML>
<BEGIN:: DCSE-TRAINING>
<END:: DCSE-TRAINING>
<BEGIN:: GOOD-CAREER>
<BEGIN:: GOOD-CAREER>
<I SAID BEGIN:: GOOD-CAREER>
<BEGIN:: METHOD:: GIVE-UP>
</XML>
 
Note that i have a system clock right next to the timer, so the seconds vs
timer ticks can be monitored very easily. I use the Label2.Text =
My.Computer.LocalTime.ToLongTimeString to computate the local time label.
--
<XML>
<BEGIN:: DCSE-TRAINING>
<END:: DCSE-TRAINING>
<BEGIN:: GOOD-CAREER>
<BEGIN:: GOOD-CAREER>
<I SAID BEGIN:: GOOD-CAREER>
<BEGIN:: METHOD:: GIVE-UP>
</XML>
 
Very informative... but i think that it's N00B proof. Will take me a little
time to dissassemble it and rewrite it for my application. Much appreciated.
--
<XML>
<BEGIN:: DCSE-TRAINING>
<END:: DCSE-TRAINING>
<BEGIN:: GOOD-CAREER>
<BEGIN:: GOOD-CAREER>
<I SAID BEGIN:: GOOD-CAREER>
<BEGIN:: METHOD:: GIVE-UP>
</XML>
 
In other words - 3000 as the interval equals 3 seconds. 1,800,000 would be
30 minutes.

Locke
 
Back
Top