static void Main(string[] args)
{
//creating the cancelation token
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
CancellationToken token = [login to view URL];
//creating the task
Task task = new Task(() =>
{
for (int i = 0; i < 100000; i++)
{
if ([login to view URL])
{
[login to view URL]("Cancel() called.");
return;
}
[login to view URL]("Loop value {0}", i);
}
}, token);
[login to view URL]("Press any key to start task");
[login to view URL]("Press any key again to cancel the running task");
[login to view URL]();
//starting the task
[login to view URL]();
//reading a console key
[login to view URL]();
//canceling the task
[login to view URL]("Canceling task");
[login to view URL]();
[login to view URL]("Main method complete. Press any key to finish.");
[login to view URL]();
}
Hello Sir,
I'm an E.C. Engineer and having related skills as per your need for this project. I've done few projects on MATLAB, Arduink UNO. I also have enough knowledge about python coding. If you need help for this project then hire me will do further discussion in chat. Feel free to reply back.
Thank You.