How to monitor and record the switch out of a thread?

Kira Yamato 1 Reputation point
2023-03-24T06:09:41+00:00

Hello everyone~

I am working with a process which simulate the running of a robot and draw it in C# .NetFramework 4.7.2 on Windows 10.

I have a dedicated thread to compute the state of robot and assign it with the highest priority.

The computation takes less than 1 ms and repeated forever.

However, the duration between two successive computation in this thread is not stable which may be 400ms sometimes.

I suspect a thread switch result this, but I can not prove.

So, is there any tool or method that I can monitor and record the switch of the worker thread?

Thank you

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,375 questions
{count} votes