[ Index ]

PHP Cross Reference of phool

title

Body

[close]

/Phool/Debug/ -> Counter.php (source)

   1  <?php
   2  //============================================================================
   3  // This program is free software: you can redistribute it and/or modify
   4  // it under the terms of the GNU Lesser General Public License (LGPL) as
   5  // published by the Free Software Foundation, either version 3 of the License,
   6  // or (at your option) any later version.
   7  //
   8  // This program is distributed in the hope that it will be useful,
   9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11  // GNU Lesser General Public License for more details.
  12  //
  13  // You should have received a copy of the GNU Lesser General Public License
  14  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
  15  //============================================================================
  16  /**
  17  * @copyright Francois Laupretre <phool@tekwire.net>
  18  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, V 2.0
  19  * @category phool
  20  * @package phool
  21  */
  22  //============================================================================
  23  
  24  namespace Phool\Debug;
  25  
  26  class Counter
  27  {
  28  
  29  //---------
  30  
  31  public static $nb=0;
  32  public static $time=0.0;
  33  private static $t;
  34  
  35  public static function start()
  36  {
  37  self::$t=microtime(true);
  38  }
  39  
  40  public static function end()
  41  {
  42  self::$time+=(microtime(true)-self::$t);
  43  self::$nb++;
  44  }
  45  
  46  public static function display()
  47  {
  48  echo '>>> Count: '.self::$nb.' ; Time: '.self::$time."\n";
  49  }
  50  
  51  //----------
  52  } // End of class
  53  //=============================================================================
  54  ?>


Generated: Thu Jun 4 19:17:11 2015 Cross-referenced by PHPXref 0.7.1