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