Speed up timer on OSX and Windows by precomputing seconds_per_tick.

Testing on my OSX laptop, this sped up timer begin/end from 5.2 M/sec
to 28 M/s, i.e. reduces the overhead of using timers by 80%.
Simplify timer.h to have fewer platform-dependent if's.