Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Time until event

by petral (Curate)
on Sep 19, 2002 at 21:56 UTC ( [id://199316]=note: print w/replies, xml ) Need Help??


in reply to Re: Time until event
in thread Time until event

  "I wonder if printing out backspaces isn't the most efficient way to erase the line."

Actually, "\r" serves that purpose, unless you are overprinting in mid-line.   But even then, simply reprinting the unchanging beginning of the line still seems simplest.
eg,
printf(" %3d %s\r", $time, $line); while(--$time) { sleep 1; printf(" %3d\r", $time); } print"\n";
See this whirligig for a similar function.

  p

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found