supercollider/supercollider — pull request #1286 by muellmusik (2014-12-26 20:22:03+00:00)
Title: Topic/timing cleanup

This PR arises from some extended discussions regarding the timing implementation on the list. It adds one new feature, cleans up some stuff, and unifies the lang timing implementation across platforms.

One question: This PR uses chrono::high_resolution_clock for elapsedTime and scheduling. According to the C++11 spec high_resolution_clock may or may not be steady. So the question is whether it is more important that the clock be monotonic, or that it be high resolution. If the former, chrono::steady_clock could be used instead. NB
- In current master it is not steady, this could cause problems, but I think only in very rare cases (e.g. scheduling across daylight savings time adjustments).
- On OSX steady_clock and high_resolution_clock are the same, both mach_absolute_time, which is monotonic.
- On other platforms what they are seems to depend on which compiler is used, etc.

I have not been able to test this on Windows or Linux, so someone please do!