From 1150141ead2cf0920624833e37536da9afd9e089 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Wed, 21 Jun 2000 17:36:36 +0000 Subject: Changed the name of the new function from "add_interval_timeout" to "repeat_timeout", which is shorter and more accurately describes what it does. GLUT_STROKE_*_ROMAN in glut.h are defined as 0,1 on WIN32 to match the glut header files there. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1232 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/functions.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'documentation/functions.html') diff --git a/documentation/functions.html b/documentation/functions.html index a79bdd1fd..d2a06357a 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -303,23 +303,25 @@ Add a one-shot timeout callback. The function will be called by Fl::wait() at t seconds after this function is called. The optional void* argument is passed to the callback. -

static void Fl::add_interval_timeout(float t, void (*cb)(void*),void*v=0)

+

static void Fl::repeat_timeout(float t, void (*cb)(void*),void*v=0)

-Add a one-shot timeout callback. The difference from add_timeout is that the time is measured from -when the last timeout callback was called, rather than from the moment -this function is called (if no timeout has been called recently the -time is measured from the next call to Fl::wait). This is designed -for making regularly-spaced timeouts at high speed (like for movie -playback), it also has slightly less system-call overhead than -add_timeout. +Inside a timeout callback you can call this to add another timeout. +Rather than the time being measured from "now", it is measured from +when the system call elapsed that caused this timeout to be called. This +will result in far more accurate spacing of the timeout callbacks, it +also has slightly less system call overhead. (It will also use all +your machine time if your timeout code and fltk's overhead take more +than t seconds, as the real timeout will be reduced to zero). + +

It is undefined what this does if called from outside a timeout +callback.

This code will print "TICK" each second on stdout, with a fair degree of accuracy: