Listing 8: (a) RTLinux semaphore test; (b) RTLinux semaphore output.

(a)
Thread A
   clock_gettime(CLOCK_REALTIME, &start);
   sem_post(&sem);
Thread B
   sem_wait(&sem);
   clock_gettime(CLOCK_REALTIME, &end);

(b)
Semaphore Latency: (96h 0m 0s test)
48.0 us