Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2. // L'astuce est bien de récupérer l'instance StopWatch du container,
  3. // éventuellement via auto-injection (sous Symfony 4),
  4. // mais pas d'en créer une nouvelle (ie, new Stopwatch()...).
  5. $stopwatch = $this->container->get('debug.stopwatch');
  6.  
  7. $stopwatch->start('mon_temps', 'netinfluence');
  8.  
  9. // ...
  10. usleep(100);
  11.  
  12. $stopwatch->stop('mon_temps');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement