coddicat / DebounceThrottle

C# Debounce and Throttle dispatchers
MIT License
47 stars 15 forks source link

Time precision with smaller intervals #11

Closed Brunni closed 3 months ago

Brunni commented 3 months ago

Hi,

I've read about the precision of DateTime vs StopWatch: The current implementation uses the DateTime.Now to remember the current time. This could probably lead to strange behavior in one of the following cases:

At least for the second case, I was not able to get a stable unit test. So I was wondering if there is a certain lower bound for the interval, which should be used.

coddicat commented 3 months ago

@Brunni you are right, I will change it to use StopWatch and i will add some tests to archive precision <10ms today-tomorrow

coddicat commented 3 months ago

@Brunni published a new 3.0.0 version with the precision < 1ms

also added a new DebounceThreadDispatcher which used Thread instead of Task to archive maximum precision (but not recommended)

coddicat commented 3 months ago

@Brunni update me please if you have anything else