How fast is php_uname() say doing php_uname('s n') or php_uname('a'). The reason I ask is because I'd like to use it to determine which server I'm on and therefore the configuration (paths, etc).
This is related to Is there a PHP function or variable giving the local host name?
From stackoverflow
Darryl Hein
-
I just did this:
<?php $tstart = microtime(true); php_uname('a'); print 'it took '. sprintf("%f",microtime(true) - $tstart) ." seconds\n"; ?>And it produced this:
it took 0.000016 secondsThat is on a Core2Duo 2.4GHz Debian box.
I know it is an empirical test and all but I think that it shows that it will be fast enough for you.
I did not expect it to take a long time since uname only needs to make a very simple call to the kernel.
eyelidlessness : I don't know. The user's never gonna get that 0.000016 seconds back.From Adam Pierce -
$_SERVER['HTTP_HOST']From Steve
0 comments:
Post a Comment