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 require '../includes/footer.inc.php';
public function testExceptions1() { // requires v 5.3 of PHP UNIT $this->setExpectedException("QCallerException"); QTimer::stop('timer4'); }
public function testExceptions1() { $this->expectException("QCallerException", "Should not be able to stop a non-started timer"); QTimer::stop('timer4'); }