當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Timer::reset方法代碼示例

本文整理匯總了PHP中Timer::reset方法的典型用法代碼示例。如果您正苦於以下問題:PHP Timer::reset方法的具體用法?PHP Timer::reset怎麽用?PHP Timer::reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Timer的用法示例。


在下文中一共展示了Timer::reset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testReset

 /**
  * @covers BT\Timer::reset
  */
 public function testReset()
 {
     $this->object->start();
     $this->object->stop();
     $this->assertInternalType("float", $this->object->getStart());
     $this->assertInternalType("float", $this->object->getStop());
     $this->object->reset();
     $this->assertInternalType("float", $this->object->getStart());
     $this->assertInternalType("float", $this->object->getStop());
 }
開發者ID:avandrevitor,項目名稱:bt,代碼行數:13,代碼來源:TimerTest.php

示例2: test_average_calculations

 public function test_average_calculations()
 {
     $timer = new Timer();
     // This should false if the timer has not been started
     $this->assertFalse($timer->average());
     $timer->start();
     $timer->stop();
     $timer->reset();
     // Should also return false if reset
     $this->assertFalse($timer->average());
     // Set some known values
     $timer->start();
     $timer->stop();
     $timer->stop_time = $timer->start_time + 100;
     $timer->set_total_items(100);
     $timer->current_item = 4;
     $this->assertEquals(25, $timer->average());
 }
開發者ID:cmmarslender,項目名稱:timer,代碼行數:18,代碼來源:TimerTests.php

示例3:

	}
	mysql_free_result($thread_result);
	if($changed)
	$cindex->commit();
	
	//Do the upload:
	$term = new Zend_Search_Lucene_Index_Term($fileid, 'fileid');
	$docIds = $uindex->termDocs($term);
	if(count($docIds) == 0)
	{
		$doc = new Zend_Search_Lucene_Document();
		$doc->addField(Zend_Search_Lucene_Field::Keyword('fileid', $fileid));
		$doc->addField(Zend_Search_Lucene_Field::Unstored('filename', $filename));
		$doc->addField(Zend_Search_Lucene_Field::Unstored('uploader', $uploader));
		$uindex->addDocument($doc);
		$uindex->commit();
	}
	echo "\n";
	flush();
}

echo "Done.\noptimizing indices... ";
flush();

$cindex->optimize();
$uindex->optimize();

echo "Done (".number_format($timer->reset(), 5)."s)\n\nUpload index size is ".$uindex->count().", ".$uindex->numDocs()." documents.\n\nComment index size is ".$cindex->count().", ".$cindex->numDocs()." documents.\n\n";


?>
開發者ID:numist,項目名稱:this-might-be-offensive,代碼行數:31,代碼來源:r348.php

示例4: LRNDA

// Make Lex object
$Lex = $Tree->make_lex();
$Lex->dump();
echo "----------\n";
// Make Grammar object
$rawgrammar = $Tree->evaluate();
$Grammar = GrammarBuilder::make($rawgrammar);
// Load special rules
$Grammar->exclude_terminal(J_EXPR_STATEMENT, '{');
$Grammar->exclude_terminal(J_EXPR_STATEMENT, J_FUNCTION);
// trash dummy rules that we used just to get redundant terminals into the Lex
$Grammar->remove_rules(J_RESERVED);
$Grammar->remove_rules(J_IGNORE);
$Grammar->dump($Lex);
echo "----------\n";
printf("Ready to build automaton after %f milliseconds\n", $Timer->reset());
// Make Parse Table object
$NDA = new LRNDA($Grammar, 1);
printf("NDA built in %f milliseconds\n", $Timer->reset());
$Table = $NDA->export();
printf("Table exported in %f milliseconds\n", $Timer->reset());
/**
 * Dump classes into files
 */
@ob_end_flush();
ob_start();
$Lex->class_export($lexname, $commentData);
file_put_contents($classdir . '/' . $lexname . '.php', "<?php\n" . ob_get_contents());
ob_clean();
$Grammar->class_export($grammarname, $commentData);
file_put_contents($classdir . '/' . $grammarname . '.php', "<?php\n" . ob_get_contents());
開發者ID:vitek-rostislav,項目名稱:jparser,代碼行數:31,代碼來源:build_ecma_262.php


注:本文中的Timer::reset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。