Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

sleep vs Win32::Sleep?

Posted on 2003-03-13
5
Medium Priority
?
674 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
4 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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

571 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