473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Short pause

I need to pause the action of my code for a quarter second or so. What can
I use to do this?

Thanks!

Bob
Aug 3 '07 #1
4 2728
"BobAchgill" <Bo********@discussions.microsoft.comschrieb
I need to pause the action of my code for a quarter second or so.
What can I use to do this?
System.Threading.Thread.Sleep(250)

But why?
Armin
Aug 3 '07 #2
I am "Hooking the keyboard" and it seems that I need to give the hooking
process some slack time so my code does not get ahead of the hooking process.
At least the pause is helping. Thanks!

Bob

"Armin Zingler" wrote:
"BobAchgill" <Bo********@discussions.microsoft.comschrieb
I need to pause the action of my code for a quarter second or so.
What can I use to do this?

System.Threading.Thread.Sleep(250)

But why?
Armin
Aug 3 '07 #3
Maybe you can create a class with a property you can set.
Make a boolean property, set it to false in the begining, and dont start
accepting any info from the keyboard until the paramter is set to true -
once you can confirm the hook is complete?

Just a thought.

Miro

"BobAchgill" <Bo********@discussions.microsoft.comwrote in message
news:0C**********************************@microsof t.com...
>I am "Hooking the keyboard" and it seems that I need to give the hooking
process some slack time so my code does not get ahead of the hooking
process.
At least the pause is helping. Thanks!

Bob

"Armin Zingler" wrote:
>"BobAchgill" <Bo********@discussions.microsoft.comschrieb
I need to pause the action of my code for a quarter second or so.
What can I use to do this?

System.Threading.Thread.Sleep(250)

But why?
Armin

Aug 3 '07 #4
BobAchgill wrote:
I am "Hooking the keyboard" and it seems that I need to give the hooking
process some slack time so my code does not get ahead of the hooking process.
At least the pause is helping. Thanks!
It's helping, but it's not guaranteed to work. Just because you are
pausing your thread for a while, doesn't mean that the thread that is
doing the hooking is guaranteed to run during that time. If the computer
is busy doing something else, the hooking process might need more time
to complete.

I agree with Miro that you should try to determine when the process
actually is complete, instead of just waiting for a while and hoping
that it is enough.

--
Göran Andersson
_____
http://www.guffa.com
Aug 4 '07 #5

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

Similar topics

0
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
5
by: Brian.Steele | last post by:
Greetings everyone. See http://www.spiceisle.com/cgi-bin/slideshow/slideshow.cgi?dir=brian/personal/2005/uk_trip/images&type=jpg The "Pause" button works in IE, but not in Firefox. Any ideas...
11
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
3
by: Michel Rouzic | last post by:
I got a loop checking if the system time has took one more second or not since last iteration, works nicely, but it uses the whole CPU. I've read many previous topics on c.l.c about wait() type...
38
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
2
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
8
by: Lloydm | last post by:
I've used the command "pause" in batch files which works ok but I guess it's applied dirrently in c++. Using Dev C++ 4.0 and the following is my code #include<iostream> #include<iomanip>...
2
by: bmerlover | last post by:
How do I use a PAUSE in .NET Framework using C++ (Visual Studio .NET 2003). I know it's system("pause") in the dos version. But I don't know what it is in the GUI version. I tried...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.