![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sleep working | meetbhattu | UNIX for Advanced & Expert Users | 2 | 10-29-2007 02:05 PM |
| Sleep Command | Glove | Shell Programming and Scripting | 1 | 10-03-2007 02:02 AM |
| Sleep() not working | enuenu | High Level Programming | 2 | 06-01-2007 10:01 PM |
| Sleep under one second | Scoogie | Shell Programming and Scripting | 5 | 08-14-2002 05:10 AM |
| sleep | Anna | UNIX for Dummies Questions & Answers | 5 | 07-10-2001 08:52 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#8
|
||||
|
||||
|
Quote:
that's right, but... you have to consider the time it takes to load/initialize perl itself and how does that time relate to the actual 'sleep' time. Take a look here: Code:
time perl -e 'select(undef,undef,undef,.001)' real 0m0.030s user 0m0.010s sys 0m0.010s |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
You're saying that the usleep doesn't "usleep" for just .1 seconds, right?
It does not matter in a multiuser, multiprocessing system. When a process "sleeps" for any time slice, the time slice is the guaranteed minimum, not the max possible or even what normally will happen. The actual wait is dictated by the quantum (time slice), the base priority of the "waking up" process relative to anybody else wating for the cpu, and the length of the queue of processes waiting for the CPU. So, if there were three same-priority processes ahead of you, the time slice is 100ms (.1 second) and you wake up from sleep, the total sleep time could be as much as the time you spent alseep plus the wait for three other processes to complete their quanta - in this case 100ms of sleep + (3 * 100ms) quantum slices = 400ms. |
|
#10
|
|||
|
|||
|
Thanks vgersh99 and jim mcnamara for your great help. This is exactly what
i want and with the explanations you gave me i know how to use it. Thanks a lot |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|