Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| info:myphp:calculer_temps_realisation_script [2018/07/18 09:45] – ↷ Page déplacée de info:git:homepage:myphp:calculer_temps_realisation_script à info:myphp:calculer_temps_realisation_script radeff | info:myphp:calculer_temps_realisation_script [2026/03/05 09:42] (Version actuelle) – radeff | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | calculer_temps_realisation_script.php | + | ====== PHP calculer temps exécution script ====== |
| - | < | + | |
| - | + | ||
| - | <? | + | |
| - | $debut | + | |
| - | /* FONCTIONS PERMETTANT DE CALCULER LE TEMPS D' | + | |
| - | function debut_calcultemps() { | + | |
| - | $trouver_temps | + | |
| - | $temps_debut | + | |
| - | return $temps_debut; | + | |
| - | } | + | |
| - | function ecrire_temps($temps_debut, | + | <code php> |
| - | $partie_temps = explode(' | + | <?php |
| - | $fin_temps = $partie_temps[1].substr($partie_temps[0], | + | // Début du calcul |
| - | $chrono = number_format($fin_temps - $temps_debut, | + | $start_time |
| - | if($precision > strlen($chrono)) { | + | |
| - | $chrono | + | |
| - | } else { | + | |
| - | $chrono = substr($chrono, | + | |
| - | } | + | |
| - | return $chrono; | + | |
| - | } | + | |
| - | echo "<!-- temps calcul: " .ecrire_temps($debut, "4") ." | + | // Votre code PHP ici |
| - | ?></ | + | // ... |
| + | |||
| + | // Fin du calcul | ||
| + | $end_time = microtime(true); | ||
| + | $execution_time = $end_time - $start_time; | ||
| + | |||
| + | echo "Temps d' | ||
| + | ?> | ||
| + | |||
| + | </ | ||