get Day / Night
Hello, im wondering if is this code good to get Night hours ? and does this can use to much CPU usage?
PHP Code:
|
Re: get Day / Night
How this could cause CPU usage ? plugin_init is called one time and also you don't need to use static. Also the array size is too big, 6 is enough for a full time string. Also your code won't work 100%, because you are not sure that plugin_init will get called(by map change, server (re)start) exactly at 00:00
|
Re: get Day / Night
1- thank you for the advice.
2- the code works great, ( tested aloot ), sure it will be called always after a map change if the time contains 00: xx / 01: xx / 02: xx etc.... 3- cant understand why array size enought for that ? |
Re: get Day / Night
Sorry, I assumed that you only want "00:xx" hour. If I remember well %H give you only the hour without minutes so it will be a string like ab. 64 cells are too much for such little string.
|
Re: get Day / Night
You might want to use this function instead:
PHP Code:
PHP Code:
|
Re: get Day / Night
Quote:
PHP Code:
|
| All times are GMT -4. The time now is 15:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.