Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

resolution of the glut-timer (Win98)

0 views
Skip to first unread message

Konstantin Baumann

unread,
Dec 14, 1999, 3:00:00 AM12/14/99
to
What is the resolution of the glut-timer (glutTimerFunc)?
I get only about 18 ticks per second for Win 98.
For Win NT, I get about 65 ticks per second. Is this difference normal?

============== 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

0 new messages