This is not just a hack. It also relies on "sudo sh -c" working and it is tied to finding the right structure of /sys. And generally not portable. But it works for me. And that is currently reason enough for me to support it. Patches to improve portability and robustness (yuck, how I am doing sudo) would be most welcome.
The loop boundary used to check @timings == $max_iterations, but @timings was incremented by an increasingly amount so could overshoot. This patch has a belt-and-suspenders approach: - Loop boundary test are ">=" - The increment is limited by the number of iterations to the max Only one of the two is necessary, but I put in both in case some future change breaks one, the other will still be there.