sys
means cpu time spent in-kernel, but you want io-wait time.
Googling turned up another stack exchange answer pointing at "per-process iowait from /proc/$pid/stat". (And maybe need to run the programmer under a debugger and set a breakpoint on exit()
/ _exit()
, so you can read out the iowait before the process goes away ?).
Often I just calculate it by subtracting the cpu time (user+sys) from the realtime. That assumes the process doesn't wait for things you don't count as "IO".