Categories

ep.debug.statistic()

Categories: Debug

ep.debug.statistic()

Plugin: ep.debug

Description: print debug statistics to console

  • ep.debug.statistic()

    version added: 6.11.0

The ep.debug.statistic() without a parameter prints the previously taken statistic to the debug console activate Firebug to see the output or open the debug console in chrome for example

  • Print statistics.

    Code:
    ep.debug.statistic();
    

ep.debug.statistic(id, function)

Plugin: ep.debug

Description: take ststistic for given function

  • ep.debug.statistic(id, function)

    version added: 6.11.0

    id   a unique id for the current function

    function   a function for which the statistic should be taken

The ep.debug.statistic() function take a statistic and collects running time for the given function the statistics which are taken are:

  • sum
  • Run a function named randomTest 100 times and take the statistic. Then print the statistic to the console

    Code:
    function randomTest(){
      for(var i = 0; i < 100; i++){
        var a = Math.random();
      }
     };
     for(var i = 0; i < 100; i++){
       ep.debug.statistic('randomStatistic',randomTest);
     }
     ep.debug.statistic();
    
    Results:
    print statistic
     statistic for id: helloWorld : sum: 14 : count: 100 : min: 0 : max: 1 : innersum: 0