============== test program (written from memory) =================
#include <GL/glut.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
static const unsigned int DELAY = 1;
static double time() {
struct _timeb t;
_ftime(&t);
return ((double)t.time) + 0.001*((double)t.millitm);
}
static void display(void) { }
static void reshape(int width, int height) { }
static void timing(int) {
glutTimerFunc(DELAY, timing, 0);
static double last = time();
static unsigned long count = 0;
if(++count % 100 == 0) {
double now = time();
printf("%f fps\n", 100.0 / (now - last));
last = now;
}
}
int main(int argc, char* argv[]) {
cerr.precision(15);
glutInit(&argc, argv);
glutCreateWindow("test");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutTimerFunc(DELAY, timing, 0);
glutMainLoop();
return 0;
}
============== test program =================
Win 98: DELAY <= 50: ~18 fps
DELAY > 50: ~ 9 fps
Win NT: DELAY < 15: ~68 fps
DELAY >= 15: ~50 fps
Can someone verify this timings?
--
Dipl.-Math. Konstantin Baumann Phone: +49-251-83-32701
Institute for Computer Science Fax: +49-251-83-33755
University of Muenster
Einsteinstrasse 62 mailto:kos...@math.uni-muenster.de
D-48149 Muenster http://wwwmath.uni-muenster.de/cs/u/kostab