Test: exec vs. shell_exec
No Description
View test history (1) Run this test again Return to test menuResult: Discarded
The test labeled "exec()" was the faster by 0.0146 seconds, (2.758% faster)
The exec() test took 0.5161 seconds.
The shell_exec() test took 0.5307 seconds.
Nitty-Gritty
Each test case ran 20 random code order iterations consisting of 136,677 loops for a total of 2,733,540 runs.
- Line execution difference (0.000005) milliseconds.
- Avg difference (0.732) milliseconds per 136,677 loops.
- Total difference 14.64 milliseconds for 2,733,540 loops
The iteration variablity for Code 1 was (2.9270) milliseconds and Code 2 was (3.1552) milliseconds. The lower and the closer together there values are the more accurate the results are.
Code
The first test, "exec()", was:
exec('ls');
The second test, "shell_exec()", was:
shell_exec('ls');