system.timers.timer elapsed handler question

  • Thread starter Thread starter GreatBigGator
  • Start date Start date
G

GreatBigGator

I have multiple timers using the same elapsed handler. I would like to
be able to determine which timer elapsed within the single handler. I
do not see a timer property that I can check.

Is there any other way to determine this information?

Thanks.
 
Hi,

GreatBigGator said:
I have multiple timers using the same elapsed handler. I would like to
be able to determine which timer elapsed within the single handler. I
do not see a timer property that I can check.

Is there any other way to determine this information?

Thanks.

The ElapsedEventHandler has a parameter called "sender" which is an object
reference to the timer that invoked the delegate. So you can just compare it
with your timers to see which one called the registered delegate.

Kind regards,
 
Thanks. I was focusing on the timer. I guess I should have focused on
the handler.

Thanks again.
 
Back
Top