replace sleep interval calculation with more correct one

The old timing routine will fall further behind the intended schedule by a fraction of a second on every iteration because it does not account for the time between that passes between the calculation of start_time and cycle_time. This new calculation should solve that problem.
Merge pull request #48 from ryancdotorg/patch-1

replace sleep interval calculation with more correct one