Created
August 20, 2018 08:53
-
-
Save binaryoung/4c9dc945ba0fc1c13c7137adb18d308b to your computer and use it in GitHub Desktop.
big data array pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('START', microtime(true)); | |
| define('START_MEMORY', memory_get_peak_usage(true)); | |
| collect(range(0, 1000000))->slice(500000)->forPage(3,20); | |
| define('END', microtime(true)); | |
| define('END_MEMORY', memory_get_peak_usage(true)); | |
| echo END - START,',',END_MEMORY - START_MEMORY; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment