Sleep for less than a second?

  • Thread starter Oldbitcollector
  • Start date
O

Oldbitcollector

Question:

I'm using the command "sleep 1" to pause a communication script I'm
working on..

Is there a way to pause for a half second, or quarter second instead of
a whole second?

Thanks
Jeff
 
J

Jack D

Oldbitcollector said:
Question:

I'm using the command "sleep 1" to pause a communication script I'm
working on..

Is there a way to pause for a half second, or quarter second instead of
a whole second?

perldoc -q sleep
 
S

Sherm Pendley

Oldbitcollector said:
Question:

I'm using the command "sleep 1" to pause a communication script I'm
working on..

Is there a way to pause for a half second, or quarter second instead of
a whole second?

Have a look at the "nanosleep()" function in Time::HiRes.

sherm--
 
B

Brian Wakem

Oldbitcollector said:
Question:

I'm using the command "sleep 1" to pause a communication script I'm
working on..

Is there a way to pause for a half second, or quarter second instead of
a whole second?

Thanks
Jeff


use Time::HiRes qw(sleep);

sleep(0.25);
 
B

Bart Lateur

Oldbitcollector said:
I'm using the command "sleep 1" to pause a communication script I'm
working on..

Is there a way to pause for a half second, or quarter second instead of
a whole second?

- 4-argument select, with no filehandles
- the module Time::HiRes, microsleep() or sleep(float)
 

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

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top