Stupid Timers

Status
Not open for further replies.
So I'm using the .net System.Timers.Timer class. Seems to work great. Except for the fact that if the timer interval elapses before it's done the first time, it launches the method again. It's re-entrant. By default. If you don't finish by the time it triggers again, why in God's name would you want to go into it again??? You'll only get further behind! I could understand "go into it again ASAP" as a behavior, but re-entrant? WHY???

The stupidest part here is there's even a note in the documentation about this and a rather long example in the Stop() method doc on how to implement a flag to work around this. Why don't you just provide a "Reentrant" property you can set to false? C'mon MS! You don't even need to change the default behavior, just provide one more property for us!

Grr.
 
So I'm using the .net System.Timers.Timer class. Seems to work great. Except for the fact that if the timer interval elapses before it's done the first time, it launches the method again. It's re-entrant. By default. If you don't finish by the time it triggers again, why in God's name would you want to go into it again??? You'll only get further behind! I could understand "go into it again ASAP" as a behavior, but re-entrant? WHY???

The stupidest part here is there's even a note in the documentation about this and a rather long example in the Stop() method doc on how to implement a flag to work around this. Why don't you just provide a "Reentrant" property you can set to false? C'mon MS! You don't even need to change the default behavior, just provide one more property for us!

Grr.
I was going to ask about just putting a lock in there. Sounds like you have that covered.
 
Hehehe. There are cases where you want that behavior, certainly, but I think MS shouldn't have made that the default.

Either way, sounds like RTFM was your friend this time.

:troll:
 
Status
Not open for further replies.
Top