5 Replies - 1668 Views - Last Post: 14 August 2012 - 12:59 PM Rate Topic: -----

#1 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 347
  • Joined: 11-July 12

Infinitive loop?

Posted 14 August 2012 - 09:32 AM

I created program, that will continuesly check one webpage and check if there are new articles. So I need to know, it is good to use infinitive loop, to continuesly check that webpage? It won't use a lot of my computer?
Is This A Good Question/Topic? 0
  • +

Replies To: Infinitive loop?

#2 LaughingBelly  Icon User is offline

  • D.I.C Head

Reputation: 47
  • View blog
  • Posts: 103
  • Joined: 11-April 11

Re: Infinitive loop?

Posted 14 August 2012 - 09:35 AM

How often are you planning to check?

If it is every second, then you incur significant enough cpu and network usage. On the other hand if you want to check once an hour or once a day, the cost is fairly low.
Was This Post Helpful? 0
  • +
  • -

#3 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1356
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Infinitive loop?

Posted 14 August 2012 - 09:37 AM

You'd be much better putting it on a timer to check the site at set intervals, rather than checking a site continuously. Otherwise, you're going to waste a lot of CPU cycles and seriously decrease the overall performance of your machine while it is running. You don't need to check a website multiple times per second anyway, which is what will happen if you just let it run continuously. You'll kill the website's bandwidth by constantly having to respond to your queries.
Was This Post Helpful? 1
  • +
  • -

#4 SPorter  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 31
  • Joined: 29-June 12

Re: Infinitive loop?

Posted 14 August 2012 - 12:33 PM

Kilorn is correct. Put your thread on a timer to check, oh I don't know, let's say once every hour. This will save the performance of your machine and still give you updates as you need them. You don't have to go every hour, but you get what I mean :)

Don't have it on an infinite loop as this will check several times per second and tank your machine.
Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7575
  • View blog
  • Posts: 12,725
  • Joined: 19-March 11

Re: Infinitive loop?

Posted 14 August 2012 - 12:52 PM

This is why RSS was invented.

It's not so bad, I guess, if you use the HEAD request instead of GET.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,436
  • Joined: 23-August 08

Re: Infinitive loop?

Posted 14 August 2012 - 12:59 PM

Just for your future searching (knowing English is not your primary language) the correct term is "infinite loop" rather than "infinitive loop". Otherwise, good job :)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1