예제 #1
0
		started - you can get the QTimer object instance, and then interrogating that
		instance:<br>
	<pre><code>$objTimer = QTimer::GetTimer('timerName');
echo $objTimer->CountStarted;</code></pre>				

	<p>Take a look at a sample usage example below by clicking View Source.</p>
</div>

<div id="demoZone">
<?php 
QTimer::start('longCalculation');
for ($i = 0; $i < 1000000; $i++) {
    // do nothing - just loop a bunch of times
}
QTimer::stop('longCalculation');
echo "Here's how long it took to execute the long calculation: " . QTimer::getTime('longCalculation') . "<br /><br />";
QTimer::start('loadPersons');
$arrPersons = Person::LoadAll();
QTimer::stop('loadPersons');
// resume the long calculation timer
QTimer::start('longCalculation');
for ($i = 0; $i < 1000000; $i++) {
    // do nothing - just loop a bunch of times
}
QTimer::stop('longCalculation');
echo "<strong>Results of QTimer::varDump():</strong><br>";
QTimer::varDump();
?>
</div>

<?php 
예제 #2
0
 public function testExceptions2()
 {
     $this->setExpectedException("QCallerException");
     QTimer::getTime('timer5');
 }
예제 #3
0
 public function testExceptions2()
 {
     $this->expectException("QCallerException", "Should not be able to get the time of a non-started timer");
     QTimer::getTime('timer5');
 }