Macintrash Posted August 31, 2010 Posted August 31, 2010 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Make this a cron, and make it run every minute. It will restart every minute, but it will run for 1 second for 60 loops. As soon as its done, the cron restarts and continues running. I have tested it and it works. Its great for codes that slow down header.php, large operations/checks can be moved here to put not even a dent in the server load, whereas putting them in header would slow down loading by at least 1 or 2 seconds. Quote
Swift-Fusion || Fusion Posted August 31, 2010 Posted August 31, 2010 One of the best ways to eat up your bandwidth i seen. Quote
Swift-Fusion || Fusion Posted August 31, 2010 Posted August 31, 2010 And why would you even need a second cron :S Quote
Macintrash Posted August 31, 2010 Author Posted August 31, 2010 And why would you even need a second cron :S Because we have one for days and minutes. Why not seconds? Regarding the bandwidth: This is only good for people with unlimited bandwidth, if your host limits you, keep it light. I suppose it could take a lot up, IF you overload it, can someone explain to me how this would destroy your bandwidth if it just runs a little script that removes people from prison if they are under level 5? Quote
Macintrash Posted August 31, 2010 Author Posted August 31, 2010 Well i suppose it wont, now that i think about it. I forgot that the server executes the PHP either way, rather than the user executing it(Oops, getting too used to C++), this is just forcing it to execute every second rather than once per click. Oh well, i guess i need to find a new way to run big scripts without problem. :( Quote
rulerofzu Posted August 31, 2010 Posted August 31, 2010 I dont see what big scripts would need this and If you ever come across one that does don't use it. Quote
Djkanna Posted August 31, 2010 Posted August 31, 2010 End it all, sleep() is underrated for sure. He tried he failed but he shared which we bash him for, that I apologize , however your ideology isn't bad but it's not going to work, Quote
Dayo Posted August 31, 2010 Posted August 31, 2010 nice try, but again timestamps (if used correctly) will be much better as you can run that code once rather then 86,400 times a day! :wacko: Quote
Dominion Posted August 31, 2010 Posted August 31, 2010 why is it when people talk about mcc cb is not around yet he is always around to get rid of posts :S anyways this mod still fails nice idea but put more work into it (even you said the way you put it out was bad but i think db get rid of that post) Quote
Macintrash Posted September 1, 2010 Author Posted September 1, 2010 This code is useful, however, in a situation where you need it ran once a second, but its being ran 10 times a second because its in header.php. Say theres lots of people clicking at once, the script is unnecessarily ran more than once per second. If you were to take advantage of this, you would actually lighten the load on your server, right? It seems to work for me, correct me if im wrong. Quote
rulerofzu Posted September 2, 2010 Posted September 2, 2010 How by any stretch of the imagination is this going to lighten the load on a server when your running a query every second? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.