a function to suspend execution, sleep() uses cpu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elnaz1010
    New Member
    • May 2010
    • 2

    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.
    Last edited by Niheel; May 9 '10, 04:43 AM. Reason: grammar spelling punctuation
  • woooee
    New Member
    • Mar 2008
    • 43

    #2
    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.

    Comment

    • elnaz1010
      New Member
      • May 2010
      • 2

      #3
      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 :)
      Last edited by Niheel; May 9 '10, 04:45 AM. Reason: grammar, punctuation

      Comment

      Working...