Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overhead of timer in application C#

Tags:

c#

.net

How much overhead do timers cause in an application if they are running in the background continuously (regardless of the interval)?

I'm not worried about the calls that the timer will make when it ticks, but rather about the performance effects of using timers in applications where performance is of the utmost importance and am interested to hear what views there are on this.

like image 785
Madeleine Avatar asked Oct 14 '10 12:10

Madeleine


1 Answers

The timer, between it's ticks, adds an extremely low cost to the application. It uses the OS's mechanism for schedualing (which is active regardless of your actions), as opposed to the intuitive concept of polling the system's clock constently.

Basicly, other then the added memory and context switch data addition (minor additions in this case. Shouldn't be more then adding a button to your form) there shouldn't be any more overhead.

like image 164
Neowizard Avatar answered Oct 03 '22 07:10

Neowizard