It might be hard to measure in a _portable_ manner, but take a look at ebpf on linux, and just instrument the relevant scheduler calls. Bonus points you …