Displaying a picture until program has completely loaded?

M

Math55

hi, i want to display the little swirling line. thats the code:

$zaehler;
my $i;
while($i<25){
print ".";
print("|");
$zaehler=0.0;

while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("/");
$zaehler=0.0;

while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("-"); $zaehler=0.0;
while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("\\");
$zaehler=0.0;
while($zaehler<100000.0){

$zaehler++;
}
print("\b");

$i++;
}

but how long? how do i know my program is ready to start?

THANK YOU!!:)
 
T

Thomas Kratz

[skipped code]
but how long? how do i know my program is ready to start?

What do you mean by "loaded" in the subject?

When exactly do you expect your "swirling line" to be displayed?

Please keep in mind:

As long as there is only one process and one thread, the only thing that your program does while swirling the line is swirling the line.

THANK YOU!!:)

Not much to thank for yet. Please clarify the question.

Thomas
 
J

John W. Krahn

Math55 said:
hi, i want to display the little swirling line. thats the code:

$zaehler;
my $i;
while($i<25){
print ".";
print("|");
$zaehler=0.0;

while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("/");
$zaehler=0.0;

while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("-"); $zaehler=0.0;
while($zaehler<100000.0){
$zaehler++;
}
print("\b");

print("\\");
$zaehler=0.0;
while($zaehler<100000.0){

$zaehler++;
}
print("\b");

$i++;
}

but how long? how do i know my program is ready to start?

You need to turn on autoflush for STDOUT.

$| = 1;

my @swirl = qw( | / - \ );

for ( 1 .. 25 ) {
print '.';
for ( @swirl ) {
print "$_\b";
sleep 2;
}
}



John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top