If I recall correctly, glfw has a cross-platform implementation of "wait_until" that would help with portability of this project.