This tests the number of context switches that occur in approximately one second. The source code is by the stackoverflow user Mecki. On this web server, the output was:
% gcc -lpthread switch.c % ./a.out Number of thread switches in about one second was 546970