<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">
<DIV>You don’t say how long you are trying to sleep for or why you want to
sleep, but every time you call Sleep you abandon the rest of your timeslice. If
you are trying to sleep for a few milliseconds you may be suprised by how long
you actually sleep as your thread has to be rescheduled after the sleep time
expires. I haven’t needed to check this on Windows 8 but a few years ago we
found that on Windows 7 the minimum sleep time was about 15mS – one system timer
tick. In fact I believe this minimum can be shorter if there are no other
threads of the same or higher priority are waiting to run but we didn’t notice
this happening. Sleep is fine for arbitrary length waits of several hundred
milliseconds or more but is useless for accurate timing and doesn’t work
properly for short timeouts.</DIV>
<DIV> </DIV>
<DIV>Andy Graham</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=slide.o.mix@gmail.com
href="mailto:slide.o.mix@gmail.com">Slide</A> </DIV>
<DIV><B>Sent:</B> Monday, January 19, 2015 10:27 PM</DIV>
<DIV><B>To:</B> <A title=ironpython-users@python.org
href="mailto:ironpython-users@python.org">ironpython-users@python.org</A> </DIV>
<DIV><B>Subject:</B> [Ironpython-users] time.sleep slowdown</DIV></DIV></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>We're
seeing some weirdness in some embedded scripting. Some of our scripts have calls
to time.sleep(), with these calls in place, from run to run of the script,
performance drops significantly, but if we remove these calls, we don't see any
slowdown. The sleep function is implemented with a call to Thread.Sleep, so I am
not sure why this would slow things down so much. Has anyone seen anything like
this, and have a way to overcome it?
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV> </DIV>
<DIV>slide</DIV>
<P>
<HR>
_______________________________________________<BR>Ironpython-users mailing
list<BR>Ironpython-users@python.org<BR>https://mail.python.org/mailman/listinfo/ironpython-users<BR></DIV></DIV></DIV></BODY></HTML>