Skip to content

Instantly share code, notes, and snippets.

@binaryoung
Created August 20, 2018 08:53
Show Gist options
  • Select an option

  • Save binaryoung/4c9dc945ba0fc1c13c7137adb18d308b to your computer and use it in GitHub Desktop.

Select an option

Save binaryoung/4c9dc945ba0fc1c13c7137adb18d308b to your computer and use it in GitHub Desktop.

Revisions

  1. binaryoung created this gist Aug 20, 2018.
    10 changes: 10 additions & 0 deletions demo.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?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;