Identify BAD scenes by looking at execution time

Gratis domotica Forums How can I …? Blocky voorbeelden Identify BAD scenes by looking at execution time

1 bericht aan het bekijken (van in totaal 1)
  • Auteur
    Berichten
  • #11723
    Avatardjandib
    Bijdrager

    Sometimes it may happen, that a scene is buggy and slows down you complete system.
    For that case, you can use microtime to have a look at the total execution time:
    **********
    PHP-Block
    //place this BEFORE any script you want to calculate time
    $time_start = microtime(true);
    **********
    PHP-Block
    //place this AFTER any script you want to calculate
    $time_end = microtime(true);
    $execution_time = round($time_end – $time_start,2);
    **********
    Add-Log Block
    **********

    In my case I added a log, if I switch on my virtual binary switch “Healthcheck” or execution_Time is > 1 sec.

    Andi
    ****************
    https://snag.gy/o7ePzG.jpg

1 bericht aan het bekijken (van in totaal 1)
  • Je moet ingelogd zijn om een reactie op dit onderwerp te kunnen geven.