当前位置: 首页>>代码示例>>C++>>正文


C++ TTimeIntervalSeconds::Int方法代码示例

本文整理汇总了C++中TTimeIntervalSeconds::Int方法的典型用法代码示例。如果您正苦于以下问题:C++ TTimeIntervalSeconds::Int方法的具体用法?C++ TTimeIntervalSeconds::Int怎么用?C++ TTimeIntervalSeconds::Int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TTimeIntervalSeconds的用法示例。


在下文中一共展示了TTimeIntervalSeconds::Int方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoTests

LOCAL_C void DoTests()
//
//  multiple threads
//
    {

	TInt r=KErrNone;
	test.Next(_L("Start continuous file Write/Read/Verify operation"));
	RThread t[KMaxNumberThreads];
	TRequestStatus tStat[KMaxNumberThreads];

	TInt i=0;

	TName threadName;
	TRequestStatus kStat=KRequestPending;
	test.Console()->Read(kStat);
	for (i=0;i<KMaxNumberThreads;i++)
		{
		ThreadTestInfo[i].iCycles=0;
		ThreadTestInfo[i].iErrors=0;
		ThreadTestInfo[i].iSizeArrayPos=(i%KMaxSizeArray);
		ThreadTestInfo[i].iErrorInfo=0;
		if (i<(KMaxNumberThreads-1))
			{
			threadName.Format(_L("MakeAndDeleteFiles%d"),i);
	    	r=t[i].Create(threadName,MakeAndDeleteFilesThread,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)i);
			}
		else
			{
			// Last thread fills/empties disk
			threadName.Format(_L("FillAndEmptyDisk%d"),i);
	    	r=t[i].Create(threadName,FillAndEmptyDiskThread,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)i);
			}
		if (r!=KErrNone)
   			test.Printf(_L("Error(%d) creating thread(%d)\r\n"),r,i);
	    test(r==KErrNone);
	    t[i].Logon(tStat[i]);
		t[i].Resume();
		}
	CurrentlyFillingDisk=ETrue;
	FillDiskCount=0;

    TInt totalTime = 0;
    TTime cycleTime;
    TTime startTime;
    TTime time;
    startTime.UniversalTime();
    cycleTime.UniversalTime();
    
	TVolumeInfo v;
	r=TheFs.Volume(v,gDriveNumber);
	test(r==KErrNone);
//	TInt initialFreeSpace = I64LOW(v.iFree / 1024);

#ifdef __LIMIT_EXECUTION_TIME__
	RTimer timer;
	timer.CreateLocal();
	TRequestStatus reqStat;
	timer.After(reqStat,60000000); // After 60 secs
#endif

#ifdef REUSE_THREAD
	RTimer displayTimer;
	displayTimer.CreateLocal();
	TRequestStatus displayStat;
	displayTimer.After(displayStat, KNotificationInterval); // after 10 secs
#endif

	TInt ypos=test.Console()->WhereY();
	FOREVER
		{
		User::WaitForAnyRequest();
		if (kStat!=KRequestPending)
			{
			// user requested to end - let threads die
#ifdef REUSE_THREAD				
			gRequestEnd = ETrue;
#endif			
			for (i=0;i<KMaxNumberThreads;i++)
				{
				User::WaitForRequest(tStat[i]);
				}
			break;
			}
#ifdef __LIMIT_EXECUTION_TIME__
		else if (reqStat != KRequestPending)
			{
			// max execution exceeded - wait for threads to die
			TInt totalCycles = 0;
			for (i=0;i<KMaxNumberThreads;i++)
				{
				totalCycles+= ThreadTestInfo[i].iCycles;
				}
			test.Printf(_L("Total cycles = %d\r\n"), totalCycles);
			test.Printf(_L("Waiting for thread death...\r\n"));
			for (i=0;i<KMaxNumberThreads;i++)
				{
				User::WaitForRequest(tStat[i]);
				}
			break;
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:t_soak1.cpp

示例2: RunTestL


//.........这里部分代码省略.........
			delete iDataSupplier;
			iDataSupplier = NULL;
			iDataSupplier = CTestDataSupplier::NewL(iSession, iInputFileName);
			iParser->ParseSource(iDataSupplier);
			}
		else
			{
			if( iUseFileHandle )
				{
				RFile file;
				User::LeaveIfError(file.Open(iSession, iInputFileName, EFileRead | EFileShareReadersOnly));
			// 	No function declaration of ParseFile() that take RFile Object parameter
			//	iParser->ParseFile(file);
				iParser->ParseFile(iSession, iInputFileName);
				}
			else
				{
				// We're testing the file mode so parse the file.
				iParser->ParseFile(iSession, iInputFileName);
				}
			}

		iState = KCheckResults;
		iStatus = KRequestPending;
		SetActive();
		}
		break;

	case KCheckResults:
		{
		// when execution begins again one parse followed by a compose would have
		// completed for the current file, handle any error messages generated here
		iErr = iParser->Error();
		TInt severity = iParser->ErrorSeverity();
		if(iErr != KErrNone)
			{
			iOutputMsg = KParseError;
			AppendErrorStr(iErr, iOutputMsg);
			AppendSeverityStr(severity, iOutputMsg);
			iOutputMsg.Append(KOutputNewLine);
			
			// IF there are no more errors for this file bung in an
			// extra line to make output more prominent
			if(iComposer->Error() == KErrNone)
				{
				iOutputMsg.Append(KOutputNewLine);
				}
			test.Printf(iOutputMsg);						// print to console
			iErrorFile.Write(DES_AS_8_BIT(iOutputMsg));	// print to error file
			
			if(iErr == KErrNoMemory)
				{
				memoryError = ETrue;
				}
			}

		iErr = iComposer->Error();
		severity = iComposer->ErrorSeverity();
		if(iErr != KErrNone)
			{
			iOutputMsg = KComposeError;
			AppendErrorStr(iErr, iOutputMsg);
			AppendSeverityStr(severity, iOutputMsg);
			iOutputMsg.Append(KOutputNewLine);
			iOutputMsg.Append(KOutputNewLine);								
			test.Printf(iOutputMsg);
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:67,代码来源:smiltranslatortest.cpp


注:本文中的TTimeIntervalSeconds::Int方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。