?
Solved

sleep vs Win32::Sleep?

Posted on 2003-03-13
5
Medium Priority
?
645 Views
Last Modified: 2007-12-19
What is the advantage to using Win32::Sleep?  (I've written a service using Win32::Daemon.)
0
Comment
Question by:rpharr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
trevorw earned 200 total points
ID: 8129672
The only difference afaik is that Win32::Sleep takes its argument in milliseconds, whereas sleep takes its argument in seconds.

So:
Win32::Sleep 1000;

and;
sleep 1;

are equivalent. Both return the number of seconds slept for (in this case 1).

Hope this helps.

Best regards,
Trevor
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 8131699
Hmm - I always thought sleep was a feature of Win32 systems - mine freezes all the time, and I'm reliably informed that it's normal behaviour for microsoft systems;)
0
 
LVL 8

Expert Comment

by:Zlatin Zlatev
ID: 8365846
advantage is more precise delays (as trevorw has mentioned Win32::Sleep takes argument in miliseconds)
Also Win32::Sleep uses Windows API function SleepEx (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/sleepex.asp) to perform the delay.

Check also:
http://archive.develooper.com/perl6-internals@perl.org/msg05963.html

My 2 cents
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9698833
Nothing has happened on this question in over 6 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by trevorw.

Please post any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question