I have a timer and I want to know if its efficient or not to test if it's the first time the timer raise the elapsed event or not (I want change the Interval property after the first time the Elapsed event is raised)
_timer = new Timer(1000);
_timer.Elapsed +=
(src, e) =>
{
FireTrigger(this, EventArgs.Empty);
if (isfirstTimeElapsed) // necessary ??
{
_timer.Interval = 5000
isfirstTimeElapsed = false;
}
};
In term of performances what's the best choice ? test or not ?