timer: document code and add a restart method.

I'm still not convinced that this belongs in Squash itself, which is
why it will remain in benchmark/ for now, but it could be useful.

The code has no dependency on Squash, which was done intentionally
to make it easier to drop a copy into other projects.

Signed-off-by: Evan Nemerson <evan@coeus-group.com>