473,756 Members | 6,852 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

High Resolution version of Sleep() in Windows


Has anyone come across a way to sleep (suspend execution of current
process while releasing CPU resources in the meantime) for less than a
millisecond in Windows? I know it has been done by third parties such
as with the XBO LLADRV project, but I cannot get even enough support
from them to enable their software in my project. Ideally, I need
something like the unix usleep() function which will do a
processor-friendly sleep for some number of microseconds or
nanoseconds. The LLADRV project supposedly does this for Windows
through low-level access to the OS using their LladrvWaitPreci seTime()
function.

I am using MSVC++ .Net 2003. Thanks for any leads.

--
Michael Evans
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 17 '05 #1
3 6233
"Michael Evans" <Mi************ ******@mail.cod ecomments.com> wrote in
message news:Mi******** **********@mail .codecomments.c om...
Has anyone come across a way to sleep (suspend execution of current
process while releasing CPU resources in the meantime) for less than a
millisecond in Windows?


Nope.

The best you can do in an application and without specialized hardware is to
use QueryPerformanc eCounter() and QueryPerformanc eFrequency() to poll the
counter while spinning a busy loop. But that would not "release CPU
resources in the meantime" as you put it.

Regards,
Will

Nov 17 '05 #2
Use SetTimer(...)/OnTimer(...)

"Michael Evans" wrote:

Has anyone come across a way to sleep (suspend execution of current
process while releasing CPU resources in the meantime) for less than a
millisecond in Windows? I know it has been done by third parties such
as with the XBO LLADRV project, but I cannot get even enough support
from them to enable their software in my project. Ideally, I need
something like the unix usleep() function which will do a
processor-friendly sleep for some number of microseconds or
nanoseconds. The LLADRV project supposedly does this for Windows
through low-level access to the OS using their LladrvWaitPreci seTime()
function.

I am using MSVC++ .Net 2003. Thanks for any leads.

--
Michael Evans
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 17 '05 #3
"in**@u-s-tech.com" <in***********@ discussions.mic rosoft.com> wrote in
message news:42******** *************** ***********@mic rosoft.com...
Use SetTimer(...)/OnTimer(...)


The OP's requirement was a preiod "less than a millisecond". And further, as
a concession to the prehistoric versions of Windows, the dispatching of
WM_TIMER messages that are synthesized in response to SetTimer() is deferred
until there is almost nothing else in the queue.

In short, SetTimer() is almost never the right choice.

Regards,
Will
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1451
by: Do Park via SQLMonster.com | last post by:
Hello all, 1. Is there a DOS command to check version of Windows server 2003 ( or 2000)? and Is there a DOS command to check version of SP in Windows Server? Thanks in advance, Do. --
2
2183
by: Ben Amada | last post by:
Hi group. I'm going to display a low resolution image in an HTML page. On the web server, I have a high resolution version of that image. If I display the high resolution image in the browser for the visitor to print, won't the DPI of the image be reduced to 72 dpi and lose resolution when the visitor goes to print the image? If this is wrong, please let me know. If this is correct, is there a way in JavaScript to be able to send the...
2
733
by: Michael Evans | last post by:
First, we rely on a stable update rate so that our physics and dynamics calculations and integrations are based on a known interval and therefore are true-to-life. Second, the graphics positions in our image generators are updated by this dynamics application, and we need to update them at the rate they are being refreshed so that we don't get any stutter from frames being used twice or having to be thrown out. Without microsecond...
6
5117
by: moondaddy | last post by:
I have an application where I need to print images where the size has been reduced down to a fraction of a thumbnail and the original image is several inches high and wide. We're using a special printing process where the dpi is 2000x2000 or higher, therefore, when I reduce the size of the image, I don't want to loose any pixels. In other words, if the image is 200 px by 200 px and I reduce the size down to 1/4 inch, I want the printer to...
12
1605
by: Xah Lee | last post by:
Python has a new logo! See http://python.org/ And it is a fantastic logo. Xah xah@xahlee.org ∑ http://xahlee.org/
3
2717
subashini Thiyagarajan
by: subashini Thiyagarajan | last post by:
Hi all, The animated flash documents are not having good resolution.can any one suggest how can i get high resolution picture in flash with good clarity.what i need to do for that. expecting some one's reply.
19
15003
by: John | last post by:
The table below shows the execution time for this code snippet as measured by the unix command `time': for i in range(1000): time.sleep(inter) inter execution time ideal 0 0.02 s 0 s 1e-4 4.29 s 0.1 s 1e-3 4.02 s 1 s
3
1348
by: Claire | last post by:
I need to read data from one of two file locations depending on whether the application is hosted on Vista or an older version of windows. On older systems its on a subdirectory of the application, on Vista on commonapplicationdata. How do I query windows version please? thank you Claire
3
1707
by: Jim Richards | last post by:
When I print out the Help files for an error, it says: "1. Make sure that the Web server computer is running a server version of Windows 2000, Windows XP, or Windows Server 2003. At this point, I do not know if my PC is acceptable for programming Web Applications. Just exactly what does "a server version of Windows XP" mean? I have Windows XP Professional w/SP2 and I have IIs and Front Page Extensions installed using the "Add/Remove...
0
9384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9212
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9779
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8645
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6473
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2612
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.