Result: DiscardedThe test labeled "time()" was the faster by 0.046 seconds, (6.286% faster)
The time() test took 0.6858 seconds.
The microtime(true) test took 0.7319 seconds.
Each test case ran 20 random code order iterations consisting of 180,361 loops for a total of 3,607,220 runs.
- Line execution difference (0.000013) milliseconds.
- Avg difference (2.300) milliseconds per 180,361 loops.
- Total difference 46.01 milliseconds for 3,607,220 loops
The iteration variablity for Code 1 was (3.1858) milliseconds and Code 2 was (5.2877) milliseconds. The lower and the closer together there values are the more accurate the results are.
The first test, "time()", was:
for ($i = 0; $i < 100; $i++) $GLOBALS['dummy'] = time();
The second test, "microtime(true)", was:
for ($i = 0; $i < 100; $i++) $GLOBALS['dummy'] = microtime(true);