当前位置: 首页>>代码示例>>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;未经允许,请勿转载。