-
$start = array_sum(explode(' ', microtime()));
- for($i=0;$i<10000;++$i) {
- strtotime("- 1 day");
- }
- $end = array_sum(explode(' ', microtime()));
- echo $end - $start ;
- echo '
';
- $start = array_sum(explode(' ', microtime()));
- for($i=0;$i<10000;++$i) {
- time() - 86400;
- }
- $end = array_sum(explode (' ', microtime()));
- echo $end - $start ;
- ?>
Copy the code
The output result is as follows: 1.13611793518 0.00332498550415 The efficiency difference is 400 times, which is indeed a big difference and deserves attention. |