How to measure context switch time



Greetings,

I was kind of thinking if there is any way to write a program to
measure the context switch time of the system.

I can understand its vague problem pointed out this way because even
the program itself might be victim of context switch (please correct
me If I am wrong).


Could anybody please shed some light.

Thanks in anticipation.

Mozis.

.