kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file BitTimer.php

Documentation is available at BitTimer.php

  1. <?php
  2. /**
  3.  * @version $Header$
  4.  *  Basic processes timer
  5.  *
  6.  * @package kernel
  7.  */
  8.  
  9. /**
  10.  * @package kernel
  11.  */
  12. class BitTimer {
  13.     function parseMicro( $micro ) {
  14.         list( $micro, $sec ) = explode( ' ', microtime() );
  15.         return $sec + $micro;
  16.     }
  17.  
  18.     function start( $timer = 'default' ) {
  19.         $this->mTimer[$timer] = $this->parseMicro( microtime() );
  20.     }
  21.  
  22.     function stop( $timer = 'default' ) {
  23.         return $this->current( $timer );
  24.     }
  25.  
  26.     function elapsed( $timer = 'default' ) {
  27.         return $this->parseMicro( microtime() ) - $this->mTimer[$timer];
  28.     }
  29. }
  30.  
  31. /**
  32.  * Create timer
  33.  */
  34. global $gBitTimer;
  35. $gBitTimer = new BitTimer();
  36. $gBitTimer->start();
  37. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:07 +0000 by phpDocumentor 1.5.0-lsces