Hi, I'm writing an application that drives a video signal to a projector for use with high speed structured light patterns and require the signal to be exactly 60hz . The problem is that the computations done per pixel vary per frame so each frame can take a different time to render. I can get the program running at around 60hz but it tends to wander between 59 and 61 hz. I can get it a bit better by counting the millis since the program began and only output a frame every 16.666 ms (1/60th sec). I do this by using the the current number of millis from the next multiple of 16.666 and then use the delay command to wait for for a number of milliseconds before the screen update. Can anybody think of a better way to do this ? I'm using p2d as the performance of OpenGL is very poor in comparison. Also can anybody thi k of a way of sleeping less than 1millisecond ?
Thanks
1