Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbenchmark.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezbenchmark.php 9392 2002-04-05 08:10:04Z bf $
5 //
6 // Definition of eZTextTool class
7 //
8 // Created on: <23-Jan-2001 12:34:54 bf>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
46 class eZBenchmark
47 {
51 function __construct( )
52 {
53
54 }
55
59 function start()
60 {
61 $this->StartTime = microtime();
62 }
63
67 function stop()
68 {
69 $this->StopTime = microtime();
70 }
71
75 function elapsed()
76 {
77 list($usec, $sec) = explode(" ", $this->StartTime);
78 $Start = (float)$usec + (float)$sec;
79 list($usec, $sec) = explode(" ", $this->StopTime);
80 $Stop = (float)$usec + (float)$sec;
81
82 $elapsed = $Stop - $Start;
83 $elapsed = number_format( ( $elapsed ), 2 );
84 return $elapsed;
85 }
86
90 function printResults( $return=false )
91 {
92 $elapsed = $this->elapsed();
93 if ( $return == false )
94 {
95 print( "Time elapsed: " . $elapsed . " seconds.<br>" );
96 }
97 else
98 {
99 return "Time elapsed: " . $elapsed . " seconds.<br>";
100 }
101
102 }
103
104
105 var $StartTime;
106 var $StopTime;
107 }
108
109 ?>
eZBenchmark
Definition: ezbenchmark.php:47
eZBenchmark\printResults
printResults( $return=false)
Definition: ezbenchmark.php:90
eZBenchmark\stop
stop()
Definition: ezbenchmark.php:67
eZBenchmark\__construct
__construct()
Definition: ezbenchmark.php:51
eZBenchmark\start
start()
Definition: ezbenchmark.php:59
eZBenchmark\$StartTime
$StartTime
Definition: ezbenchmark.php:105
eZBenchmark\$StopTime
$StopTime
Definition: ezbenchmark.php:106
eZBenchmark\elapsed
elapsed()
Definition: ezbenchmark.php:75
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.