[SPIP] ~version 3.0.7-->3.0.10
[ptitvelo/web/www.git] / www / ecrire / public / compiler.php
index c21b6f2..b158673 100644 (file)
@@ -380,6 +380,7 @@ function calculer_boucle_rec($id_boucle, &$boucles, $trace) {
  * %s8: code de trace eventuel avant le retour
 **/
 define('CODE_CORPS_BOUCLE', '%s
+       if (defined("_BOUCLE_PROFILER")) $timer = time()+microtime();
        $t0 = "";
        // REQUETE
        $iter = IterFactory::create(
@@ -393,6 +394,9 @@ define('CODE_CORPS_BOUCLE', '%s
        %s
        %s$iter->free();
        }%s
+       if (defined("_BOUCLE_PROFILER")
+       AND 1000*($timer = (time()+microtime())-$timer) > _BOUCLE_PROFILER)
+               spip_log(intval(1000*$timer)."ms %s","profiler");
        return $t0;'
 );
 
@@ -549,7 +553,8 @@ function calculer_boucle_nonrec($id_boucle, &$boucles, $trace) {
                $init_lang,
                $corps,
                $fin_lang,
-               $trace
+               $trace,
+               'BOUCLE'.$id_boucle .' @ '.($boucle->descr['sourcefile'])
        );
 
 #      var_dump($a);exit;