The detection function supports functionisfun ($ funName) {return (false! Function_exists ($ funName ))? & Amp; 39; supported & amp; 39;: & amp; 39; & lt; fontcolorred & gt; not supported & lt; font & gt; & amp;
- // Detection function support
- Function isfun ($ funName ){
- Return (false! = Function_exists ($ funName ))? 'Supported ': 'unsupported ';
- }
- // Integer computing capability test
- Function test_int (){
- $ TimeStart = gettimeofday ();
- For ($ I = 0; I I <3000000; $ I ++ ){
- $ T = 1 + 1;
- }
- $ TimeEnd = gettimeofday ();
- $ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
- $ Time = round ($ time, 3). "seconds ";
- Return $ time;
- }
- // Floating point computing capability test
- Function test_float (){
- // Obtain the circumference rate
- $ T = pi ();
- $ TimeStart = gettimeofday ();
- For ($ I = 0; I I <3000000; $ I ++ ){
- // Square
- Sqrt ($ t );
- }
- $ TimeEnd = gettimeofday ();
- $ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
- $ Time = round ($ time, 3). "seconds ";
- Return $ time;
- }
- // IO capability test
- Function test_io (){
- $ Fp = @ fopen (PHPSELF, "r ");
- $ TimeStart = gettimeofday ();
- For ($ I = 0; I I <10000; $ I ++ ){
- @ Fread ($ fp, 10240 );
- @ Rewind ($ fp );
- }
- $ TimeEnd = gettimeofday ();
- @ Fclose ($ fp );
- $ Time = ($ timeEnd ["usec"]-$ timeStart ["usec"])/1000000 + $ timeEnd ["sec"]-$ timeStart ["sec"];
- $ Time = round ($ time, 3). "seconds ";
- Return ($ time );
- }