Created
March 15, 2019 15:23
-
-
Save romaricdrigon/ad02f0021c4f29c2fff280186ceb0495 to your computer and use it in GitHub Desktop.
Exemple d'utilisation du Stopwatch
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 | |
// L'astuce est bien de récupérer l'instance StopWatch du container, | |
// éventuellement via auto-injection (sous Symfony 4), | |
// mais pas d'en créer une nouvelle (ie, new Stopwatch()...). | |
$stopwatch = $this->container->get('debug.stopwatch'); | |
$stopwatch->start('mon_temps', 'netinfluence'); | |
// ... | |
usleep(100); | |
$stopwatch->stop('mon_temps'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment