I have the follow code for example
static void Main(string[] args)
{
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
for (int i = 0; i < 100; i++)
{
new Task(()=> { DoCalc(); }).Start();
}
Console.ReadLine();
}
private static void DoCalc()
{
Console.WriteLine("I'm working");
}
and I want to limit my cpu usage to 80%, how can I do it?
thanks a lot