Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 6, 2018 8:52 AM
Views: 19
  1. $this->benchmark->mark('dog');
  2.  
  3. // Some code happens here
  4.  
  5. $this->benchmark->mark('cat');
  6.  
  7. // More code happens here
  8.  
  9. $this->benchmark->mark('bird');
  10.  
  11. echo $this->benchmark->elapsed_time('dog', 'cat');
  12. echo $this->benchmark->elapsed_time('cat', 'bird');
  13. echo $this->benchmark->elapsed_time('dog', 'bird');
  14.  
  15. //Displaying Memory Consumption
  16. echo $this->benchmark->memory_usage();