If I run something like Sleep(10000), and the system clock changes during that, will the thread still sleep for 10 seconds of wall-clock time, or less or more? I.e. does the Sleep() function convert milliseconds into hardware ticks?
...
hi everyone,
I'm trying to extract some values out of a file and into my excel 2007 workbook, using VBA and the dreaded Sendkeys function (copy-paste) after a shellexecuteEx call.
Now, my macro is working fine when the file in question has already been loaded into the system memory. But if I'm running it with the file never having been ...
I'm uploading a file, all working fine, but I want to set a time for 60 seconds, so it waits for the file to upload before moving on.
Any ideas?
...
I recently came across the need to sleep the current thread for an exact period of time. I know of two methods of doing so on a POSIX platform: using nanosleep() or using Boost::this_thread::sleep().
Out of curiosity more than anything else, I was wondering what the differences are between the two approaches. Is there any difference i...
Hello,
I want PHP to output some text, then sleep for a minute and a half, and then output some more text.
<?php
echo 'Output one.';
usleep(1500000);
echo 'Output two.';
?>
My problem is that all text is being put out simultaneously - after having waited those 1.5 seconds. I have read something about a function called flush - but...
I have an app with some animations which are called by timers. When one animation finishes then a timer is called to start another. If the iPhone sleeps and requires unlocking to activate it then the animations do not start. This is obviously because the timer ends whilst the app is asleep and then the function to restart an animation do...
Hi, I have a little problem and I would be gratefull if someone could help me. I got 5 UIButtons placed next to each other and what I wanna do is set image on first button, redraw it so it, wait for 1 second, then set some other image on second button, redraw second button and so on.
I tried to set image on button, then call function sle...
I am currently coding a Java WebService using axis2. However, one particular request needs me to do constant polling a status in another server for around 3-10 seconds time.
I want to use Thread.sleep to do polling like every 500 mili for 3 seconds. Does it have any implication like performance issue or can anyone suggest a better idea...
Is there a way to put a thread to sleep for many days with a resolution of microseconds? usleep can only put the thread to sleep for 1000000 and sleep works in second steps. Is there a way to, may be, use both sleep and usleep to achieve this?
...
Hi all,
I had used the following code to prevent the iPhone from entering the sleep mode.
[UIApplication sharedApplication].idleTimerDisabled=YES
But is it possible to put the iphone in Sleep mode programatically ?
Thanks
...
I have a program whose only purpose is to drive a java.awt.Robot in an infinite loop until an exit condition is met.
The robot performs a number of actions in quick succession, which require a standard UI delay between them. For this, I use java.awt.Robot.setAutoDelay(int ms), which appears to be designed for precisely this purpose.
At...
I'm trying to make a web browser that tells me when a specific video is done. I already know how to get the time in seconds of how long it takes. I just need to know how to wait to execute the next step without stopping the webbrowser control (which needs to play the flash video).
Any ideas? I've been looking into the Timer class, but c...
Hi,
By default, Wifi sleep policy is "Sleep on screen idle".
With this policy, is it possible for a Background Service at a later time to wake up Wifi using some API?
Am trying the following, but does not work:
When my Background Service wakes up, it calls "ConnectivityManager.getActiveNetworkInfo()" to get active network.
Since, the ...
I have a quite simple perl script, that in one function does the following:
if ( legato_is_up() ) {
write_log("INFO: Legato is up and running. Continue the installation.");
$wait_minutes = $WAITPERIOD + 1;
$legato_up = 1;
}
else {
my $towait = $WAITPERIOD - $wait_minutes;
write_...
I'm creating a daemon that will be installed in the LaunchAgents folder. Some questions about making it sleep:
Because it's a LaunchAgent item will the executable automatically sleep when the user/system sleeps?
If the answer is yes to question 1, do I need to specify anything in the plist document?
If the answer is no to question 1, w...
Hi guys,
In my app, I have a thread that runs continuously. By using Thread.Sleep(), the function executes every 10 minutes.
I need to be able to kill this thread when a user clicks a button. I know Thread.Abort() is not reliable. I can use a variable to stop the thread, but since it is sleeping it could be another 10 minutes before th...
I was wondering if there was an event that is triggered when a laptop or desktop goes into sleep mode.
An example would be:
When a user is working on his/her laptop and he/she flips the monitor down, the laptop goes into sleep mode.
Or when a user goes to Start → Shutdown → Sleep.
Are there any events built into .NET that determine t...
I want it to run the first line print 1 then wait 1 second to run the second command print 2, etc.
Pseudo-code:
print 1
wait(1 seconds)
print 2
wait(0.45 seconds)
print 3
wait(3 seconds)
print 4
...
I need to sleep my program in Windows. What header file has the sleep function?
...
Is there any notification I can listen to that will alert me that the phone will go to sleep? I have implemented the following:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(resignActive:)
name:UIApplicationDidEnterBackgroundNotification
...