Throttle part 1

This will stop it running too fast and is a little more portable.

Can you merge this in, then I can get working on threaded version.