I know there are benchmarking programs that exist, but I've decided that as an exercise, I want to try and create some sort of simple benchmark program to test schedulers of my Raspberry Pi (CFQ, noop, deadline). I have been switching the schedulers and testing some linux commands using time and notice several differences.
My question is: if I want to create a c program that's able to run and test the result of using a specific scheduler, how should I tackle this?
I guess a simple outline of an idea I have is: program creates multiple threads with different instructions like looping through performing addition, reading, writing, etc. Then start all the threads and each time it completes the task, record the time which it took place in each thread. Then with the time given, I can find the total time it took for the thread to complete, average time for each instruction before it was completed, and also compare the order in which they were chosen by the CPU.
Does this sound like a plausible idea? Any flaws to it? How else can I test context-switching, paging, or anything else that I may have missed?