Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Deep recursion in Tk repeat

by benn (Priest)
on Sep 01, 2003 at 16:19 UTC ( #288158=note: print w/ replies, xml ) Need Help??

in reply to Deep recursion in Tk repeat

Rather than attempting to guess the refresh rate beforehand, you could work it out at runtime, then use this to drive your main loop - something roughly like...(untested, obviously)

use Time::Hires; $avg_num=10; # or whatever $s=time(); #Time::Hires floating-point drop-in $taxis->taxis() for (0..$avg_num); $refresh = (time()-$s)/$avg_num; $refresh = $sensible if ($refresh < $sensible;} while(1) { $start=time(); $taxis->taxis(); do { DoOneEvent( $running ? DONT_WAIT : ALL_EVENTS ); } until (time()-$start > $refresh); }
Cheers, Ben.

Comment on Re: Deep recursion in Tk repeat
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://288158]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2015-11-30 04:07 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (757 votes), past polls