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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top