C# task repeat every x count

Multi tool use
Multi tool use


C# task repeat every x count



There are currently many solutions on StackOverflow using C# task to repeatedly do some work every x time interval. I would like to do it repeatedly to say every 100 counts of a counter. This counter is not time-based but is actually a number of values stored into an array for example. Is there any tutorial which could give an idea on how to implement this?





Gimme teh tutorialz is not a valid question for stackoverflowz
– TheGeneral
Jul 2 at 10:12






Try using TaskScheduler Class (msdn.microsoft.com/en-us/library/…).
– Afonso
Jul 2 at 10:18





@Afonso This is terrible advice. The name "TaskScheduler" sounds good, but it actually doesn't do what you might think it does. This is used for scheduling tasks internally to thread pool. There is absolutely no reason to call this class.
– FCin
Jul 2 at 10:36






@TheGeneral Maybe not tutorial but some direction. I feel that the Task class in C# is very useful especially for data acquisition but instead of time based, a counter based would be also equally useful if we wanted to do analysis say every 1000 samples regardless of how long the data took.
– user990639
Jul 2 at 14:23




1 Answer
1



Something like this ?


if (i%100 == 0)
{
// do something
}






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Rbwh,F jjO,XZiStS NN9PMxTDim,FJvfO8B
MecCLOt6q,T5IfEx,dwnOerdQ7OK WHNK QLCYGd5,4gHvyjZD syf,PgR14sh1kj8oW AG6,H6q gHG61,xNNgHxJgd

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications