I’m searching the net without success for a way to make the “Timer” object faster.
I have read in various forums that it has a maximum accuracy of 55 milliseconds.
I would like to understand if it is possible to have a process that is faster than 55 milliseconds per cycle.
I’m producing complex software that allows me to create RPG game levels.
The project uses the normal “Timer” object and works fine.
But I would like to make it faster to have more stability.
Question:
In my timer at the “Tick” event I have a lot of code that is executed.
If I split the code on two or three timers, do I increase performance?
The more code I put inside the “Tick” event, is everything slowed down or multiple processes are generated?
Is there a way to speed up the timer or make faster all the code that is called at the “Tick” event?
I tried using the “System.Timer” class
but nothing seems to change from the classic timer…
This is the example:
Public Class Form1
Public Timer As New System.Timers.Timer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler Timer.Elapsed, AddressOf Timer_Tick
Timer.AutoReset = True
Timer.Interval = 1
Timer.Start()
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = False
End Sub
Private Sub Timer_Tick(source As Object, e As EventArgs)
Label1.Text = Val(Label1.Text) + 1
End Sub
End Class
Thank you all for your help!!! 🙁
I tried to search the net, but I didn’t find much…
Often the examples are always in C#, when I use Basic which suits me better…
MizzardNet7 Net7 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
7