Page 1 of 1

Best way to use a timer

Posted: Tue Sep 08, 2015 10:47 am
by Dummy1912
Hello,

i was wondering if somebody can show me
the best way to use a Timer without using to much of the cpu or memory

because i have noticed that if a timer keeps running every few minutes to check a sub the cpu / memory gets really high

Thank you

Regards,

Dummy1912

Re: Best way to use a timer

Posted: Tue Sep 08, 2015 12:17 pm
by visualtech
According to my analysis, using multiple thread pools is the apt solution as it prevents any memory lock and memory leak.

Re: Best way to use a timer

Posted: Tue Sep 08, 2015 1:39 pm
by Dummy1912
Hello,

In my old application i ever used this thread before
and must say takes lots of cpu and memory
Code: Select all
DemoThread = New Thread( _
        New ThreadStart(AddressOf Me.GetSub)
                    DemoThread.Start()
Code: Select all
Public Sub GetSub()
        While Me.Visible
                            For Each item As Control In Panel1.Controls
                    CType(item, listed).GetDemo()
                Next
        End While
    End Sub
Regards,
Dummy1912