在Windows窗体应用程序中,调用的影响Thread.Sleep(1)如下面的代码所示:
public Constructor()
{
Thread thread = new Thread(Task);
thread.IsBackground = true;
thread.Start();
}
private void Task()
{
while (true)
{
// do something
Thread.Sleep(1);
}
}
Run Code Online (Sandbox Code Playgroud)
这个线程会占用所有可用的CPU吗?
我可以使用哪些分析技术来测量此线程的CPU使用率(除了任务管理器)?