I found several examples of how to get the PrivilegedProcessorTime and UserProcessorTime for a process and for all threads, but how do I get the PrivilegedProcessorTime and UserProcessorTime for the current managed thread.
private void button1_Click(object sender, EventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(WorkCore));
}
static void WorkCore(Object stateInfo)
{
// Code to get and do work
// Code to get and log PrivilegedProcessorTime and UserProcessorTime
}