I know how to call method after interval.
public void afterInt(int s) {
Task.Factory.StartNew(() => {
System.Threading.Thread.Sleep(s);
// calling method
});
}
But I don't wanna create a new task for each scroll event, I'd like to:
- edit a interval for a current task
or
- remove a current task and create a new one with a new interval
May anybody help me with that? I have no clue where to start.