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

Developer technologies | .NET | Other
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.