Hacker News new | ask | show | jobs
by willis936 1681 days ago
I think the real solution I should have adopted is incrementing t like this:

  t = mod(t + ts, 1 / f)
Since I'm just sending a static frequency the range of time never needs to be beyond one period. However, using a double here is far from the critical path in increasing performance and it all runs fast enough anyway.