Reputation: 1597
I need to implement a function that contains a loop of instructions that should run every .01 second is there a way to implement a loop(e.g for each time step) that can do that thanks in advance
Upvotes: 3
Views: 5504
Reputation: 13049
You can use Timer class like this:
Timer t = new Timer(100);
t.Elapsed += (sender, e) =>
{
for (int i = 0; i < 10; i++)
{
// your loop
}
};
t.Start();
Upvotes: 8