473,396 Members | 1,724 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,396 software developers and data experts.

a function to suspend execution, sleep() uses cpu

I am using my host to run a python script as a program.
My script is checking a website every 15 minutes and get the news but the problem is sleep() uses cpu, and my host won't accept this.

I want a function or a method to block the execution until 15min later.

I tried to use semaphores, but it require some library which my host won't install them for me.
May 7 '10 #1
2 1647
woooee
43
sleep() of course has to check the time periodically to see if it should wake up. If you can, submit the program every 15 minutes to the host, run and exit.
May 8 '10 #2
Thanks for your reply, I appreciate it, but the problem is 15 minutes is not a static running time.
In some situation, 15min will reduce to 30 second, and thats when I can submit it.

Another problem is my script is going to be a crawler, it should be automatic. If I submit it every 15min, it require a request. As you know this method is not making a crawler.

Anyway, thanks :)
May 9 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Colin Brown | last post by:
Python 2.3.3 Under Windows NT: Negative Int or Real -> sleeps for a long time Under Linux: Returns IOError: Invalid argument I consider both of these unfriendly results and expected the...
8
by: Nick Coghlan | last post by:
Time for another random syntax idea. . . So, I was tinkering in the interactive interpreter, and came up with the following one-size-fits-most default argument hack: Py> x = 1 Py> def...
6
by: Manuel | last post by:
Can I invoke a function before main I could do it by invoking it in a Global object's constructor . Is there any other method other than this. Manuel
26
by: news.microsoft.com | last post by:
Hi, Currently I have a thread thats spinning and doing a Thread.Sleep(someTime). I was thinking of changing this to Thread.Sleep(Timeout.Infinite); then when I have actual data in a...
3
by: kiplring | last post by:
Suppose a function which has Sleep() method in it. And I want to recycle it. I made two buttons which call "Resume()" and "Suspend()". But It doesn't work. The state of thread "t" will be...
3
by: Michael Evans | last post by:
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...
2
by: | last post by:
I'm writing web applications. I build and extend a lot of custom objects, and in the course of debugging my apps I invariably find myself writing a lot of junky code: Response.Write("Title: " +...
4
by: Darren Dunham | last post by:
I've had to do some work with an existing PHP application. Unfortunately, the app is pretty big, undocumented, and heavily (and in some places, inappropriately) abstracted. I've spent a day with...
0
by: Virat Sarswat | last post by:
was trying to suspend and resume the inprocess function calls using .Net threading but didn't get success. for making it more clear below is the code i used Thread ThreadSuspend = new...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...

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.