dooberwah has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to make some simple text animations in a program and was wondering how the best way to pause for a small amount of time before switching "frames" is. I'm doing really simple stuff, all ASCII art and just need to switch between a few pictures with small delay periods. I looked at the sleep() function and it didn't really seem to work all that well, it paused too long and The Camel Book says that it can vary by up to a second on different systems. Any help for me, the clueless newbie, would be appriciated.

-Ben Jacobs

Replies are listed 'Best First'.
Re: Simple Text Animation
by chipmunk (Parson) on Apr 23, 2001 at 03:07 UTC
Re: Simple Text Animation
by the_slycer (Chaplain) on Apr 23, 2001 at 03:08 UTC
    Read sleep and notice the last paragraph:

    For delays of finer granularity than one second, you may use Perl's syscall() interface to access setitimer(2) if your system supports it, or else see select() above. See also the POSIX module's sigpause()function.
Re: Simple Text Animation
by Beatnik (Parson) on Apr 23, 2001 at 12:36 UTC