Result: DiscardedThe test labeled "time()" was the faster by 0.0621 seconds, (5.577% faster)
The time() test took 1.0507 seconds.
The strtotime('now') test took 1.1128 seconds.
Each test case ran 20 random code order iterations consisting of 262,021 loops for a total of 5,240,420 runs.
- Line execution difference (0.000012) milliseconds.
- Avg difference (3.103) milliseconds per 262,021 loops.
- Total difference 62.05 milliseconds for 5,240,420 loops
The iteration variablity for Code 1 was (5.9130) milliseconds and Code 2 was (9.0099) 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, "strtotime('now')", was:
for ($i = 0; $i < 100; $i++) $GLOBALS['dummy'] = strtotime('now');