Listing 2: (a) RTLinux context switch time pseudocode; (b) RTLinux context switch time measurement output.

(a)
Thread A
  clock_gettime(CLOCK_REALTIME, &start);
  pthread_wakeup_np(thread_B);
Thread B
  clock_gettime(CLOCK_REALTIME, &end);
  pthread_suspend_np(thread_B);

(b)
Context Switch - Realtime thread to Realtime thread: (96h 0m 0s test)
48.2 us