Add support for automated benchmarking

This allows easy integration into benchmarking scripts; previously you'd need to kill it with a signal and then try to find the line.

The endless benchmarking mode is still supported, but now you can optionally specify the amount of rounds, and the total result is averaged over all these rounds.