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


C++ TTime::Int64方法代码示例

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


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

示例1: DoTestL

TVerdict CTestVclntRepeat::DoTestL(CVideoPlayerUtility* aPlayer)
	{
	TVerdict ret = EFail;

	INFO_PRINTF1(_L("Test : Video Player - Repeats"));

	TInt duration = I64INT(aPlayer->DurationL().Int64());

	// SetRepeats() doesn't exist in the video controller, so set iRepeat to 1
	iRepeat = 1;
	INFO_PRINTF1(_L("Warning : SetRepeats() does not exist in player API. Repeat count set to 1"));
	
	aPlayer->Play();
	INFO_PRINTF1(_L("CVideoPlayerUtility: Playing"));
	TTime start;
	start.HomeTime();
	CActiveScheduler::Start();
	TTime stop;
	stop.HomeTime();

	TUint actualDuration = I64INT(stop.MicroSecondsFrom(start).Int64());

	INFO_PRINTF6(_L("Error : %d Start = %d Stop = %d Duration = %d ActualDuration = %d"),
		iError, I64INT(start.Int64()), I64INT(stop.Int64()), duration, actualDuration);
	if((iError == KErrNone) && (TimeComparison(actualDuration, duration * (iRepeat + 1), 
											   KExpectedDeviation * iRepeat)))
		ret = EPass;

	return ret;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:30,代码来源:TestPlayer.cpp

示例2: IsPlaying

EXPORT_C TBool TWsGraphicMsgAnimation::IsPlaying(const TTime& aNow,const TTimeIntervalMicroSeconds& aAnimationLength) const
	{
	// an animation to time?
	if(aAnimationLength <= 0LL)
		{
		return EFalse;
		}
	switch(iFlags & EStateMask)
		{
		case EPaused:
			return EFalse;
		case EStopping:
			{
			const TInt64 elapsed = (aNow.Int64() - iPlay.Int64());
			if(elapsed <= aAnimationLength.Int64())
				{
				return ETrue;
				}
			return EFalse;
			}
		case EStopped:
			return EFalse;
		case EPlaying:
			{
			const TInt64 elapsed = (aNow.Int64() - iPlay.Int64());
			if((iFlags & ELoop) || (elapsed <= aAnimationLength.Int64()))
				{
				return ETrue;
				}
			return EFalse;
			}
		default:
			return EFalse;
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:35,代码来源:graphicmsgbuf.cpp

示例3: UpdateVisited

/**
Tests UpdateVisited() API
@internalTechnology
@test
@param		Reference to handle to the bookmark that is under test
@return		None
*/
void CTestUpdateVisitedStep::DoTest(RBkBookmark& aBookmark)
	{
	const TInt KOneSecond = 1000000;
	TTime initialTime;
	// Set the time to universal time
	initialTime.UniversalTime();
	INFO_PRINTF2(_L("Current time before updating = %Ld"), initialTime.Int64());
	INFO_PRINTF1(_L("Updating LastVisited..."));

	// Call updatevisited after one second
	User::After(KOneSecond);
	aBookmark.UpdateVisited();
	TTime lastVisitedTime = aBookmark.LastVisited();
	INFO_PRINTF2(_L("LastVisitedTime after updating = %Ld"), lastVisitedTime.Int64());

	// Check whether last visited is greater than the initial time
	if(lastVisitedTime <= initialTime)
		{
		INFO_PRINTF1(_L("LastVisited was not updated properly"));
		SetTestStepResult(EFail);
		}
	else
		{
		INFO_PRINTF1(_L("LastVisited was updated properly"));
		}
	}	// DoTest
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:33,代码来源:TestUpdateVisitedStep.cpp

示例4: DiffInSecs

//Returns approximate difference (rounded down?) in seconds
EXPORT_C TInt CSchSendTestUtils::DiffInSecs(TTime d1, TTime d2)
	{
	iRTest<<d1<<d2;
	TInt64 diffUs64 = d1.Int64() - d2.Int64();
	TInt64 diffSecs64 = diffUs64 / (1000000);
	TInt diffSecs32 = I64INT(diffSecs64);
	return diffSecs32;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:9,代码来源:t_schsendutils.cpp

示例5: GenerateRandomCid

// --------------------------------------------------------------------------------------
// Generates random CID
// --------------------------------------------------------------------------------------
//
void CXmlEngSerializerXOP::GenerateRandomCid(TDes8& aCid)
    {
    _LIT8(KAt, "@");
    //generate random CID as <randomNumber>@<homeTime>
	TTime now;
	now.HomeTime();
	TInt64 homeTime = now.Int64();
	TUint32 randomNumber = Math::Random();
	aCid.AppendNum(randomNumber);
	aCid.Append(KAt);
	aCid.AppendNum(now.Int64());
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:16,代码来源:xmlengserializerxop.cpp

示例6: CheckSearchResultsL

// -----------------------------------------------------------------------------
// CSTSCredentialManager::CheckSearchResultsL
// Check key search results, generate CSR
// -----------------------------------------------------------------------------
void CSTSCredentialManager::CheckSearchResultsL()
{
    // we take the first key with valid dates
    TInt keyCount = iKeyInfoArray->Count();
    CCTKeyInfo* keyInfo = NULL;
    TTime timeNow;
    timeNow.UniversalTime();

    TBool found = EFalse;
    TInt keyIndex = 0;

    for (TInt i = 0; (i < keyCount) && (!found); i++)
    {
        keyInfo = iKeyInfoArray->operator[](i);
        TTime startDate = keyInfo->StartDate();
        if ((startDate.Int64() == 0) || (timeNow >= startDate))
        {
            // startDate was not set or is before current time
            // exactly same time is valid as well
            TTime endDate = keyInfo->EndDate();
            if ((endDate.Int64() == 0) || (timeNow < endDate))
            {
                // endDate was not set or is after current time
                // exactly same time is not valid
                // (the key expires immediatelly)
                if (keyInfo->Size() == iKeyLen)
                {
                    // key must have same size
                    found = ETrue;
                    keyIndex = i;
                }
            }
        }
    }
    if (!found)
    {
        Complete(KSTSErrSeNoKeys);
        return;
    }

    if (iKeyInfo)
    {
        iKeyInfo->Release();
    }
    iKeyInfo = keyInfo;
    // iKeyInfo is no longer owned by iKeyInfoArray
    iKeyInfoArray->Remove(keyIndex);

    CSRDialog();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:54,代码来源:cstscredentialmanager.cpp

示例7: ConstructL

void CSyncEngineWrap::ConstructL()
	{
	//create suspended thread
	_LIT(KThreadName, "SyncThreadEntryPoint");

	TBuf<30> threadName;
	threadName.Append(KThreadName);

	TTime time;
	time.HomeTime();

	TInt64 aSeed = time.Int64();
	TInt randNum = Math::Rand(aSeed) % 1000;
	threadName.AppendNum(randNum);

	//KMinHeapSize, 256*KMinHeapSize                                 
	//TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x100000, 0x3D4000, this);
	TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x5000,
			0x600000, this);

	if (res != KErrNone)
		Panic(ERhodesSyncEngineInit);

	thread.SetPriority(EPriorityNormal);
	}
开发者ID:3runo5ouza,项目名称:rhodes,代码行数:25,代码来源:SyncEngineWrap.cpp

示例8: NewPolicyIdL

TVpnPolicyId CPolicyStore::NewPolicyIdL()
    {
    TUuid uuid;
    TUuidString uuidString;
    
    Uuid::MakeUuidL(uuid);

    // It has become apparent that certain
    // Symbian OS devices generate duplicate random
    // number sequences after gold boot due to improper
    // seeding of the random number generator. Should
    // this happen to be the case, we insert at least
    // one component to the UUID that depends on the 
    // current system time. This is not perfect, but 
    // should give us policy IDs that are unique enough.
    TTime now;
	now.UniversalTime();
    TInt64 randSeed = now.Int64();
    TInt randomNum = Math::Rand(randSeed);
    uuid.iTimeLow = static_cast<TUint32>(randomNum);
    
    Uuid::UuidToString(uuid, uuidString);

    TVpnPolicyId newPolicyId;
    newPolicyId.Copy(uuidString);
    
    return newPolicyId;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:28,代码来源:policystore.cpp

示例9: baseRomImage

LOCAL_C void baseRomImage()
//
// Set base addresses for the ROM image.
//
	{

	test.Start(_L("Setting up the header"));
	Mem::FillZ(&TheRomHeader,sizeof(TRomHeader));
	test.Printf(_L("1"));
	TheRomHeader.iVersion=TVersion(1,0,1);
	test.Printf(_L("2"));
	TTime t;
	t.HomeTime();
	test.Printf(_L("3"));
	TheRomHeader.iTime=t.Int64();
	test.Printf(_L("4"));
	TheRomHeader.iRomBase=UserSvr::RomHeaderAddress();
	test.Printf(_L("5"));
	TheRomHeader.iRomRootDirectoryList=TheCurrentBase=UserSvr::RomHeaderAddress()+sizeof(TRomHeader);
	test.Printf(_L("6"));
//
	test.Next(_L("Set dirs base"));
	TheRootDir->SetBaseDirs();
//
	test.Next(_L("Set files base"));
	TheRootDir->SetBaseFiles();
	TheRomHeader.iRomSize=TheCurrentBase-UserSvr::RomHeaderAddress();
//
	test.End();
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:30,代码来源:t_romg.cpp

示例10: currentTime

double currentTime()
    {
    TTime current;
    current.HomeTime();
    // second resolution instead of microsecond
    return I64REAL( current.Int64() ) / 1000000;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:7,代码来源:SystemTimeSymbian.cpp

示例11: CWatcherBase

EXPORT_C CWatcherBase::CWatcherBase(TInt aPriority)
:	CActive(aPriority)
	{
	CActiveScheduler::Add(this);

#ifdef WATCHER_TESTING    
    //-- this section of code is used by TE_TelWatchers(Unit) test 
	TTime now;
	now.UniversalTime();
	TheSeed = now.Int64();

    //-- define properties for test purposes
    OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CWATCHERBASE_CTOR_1, "CTelWatcherBase : defining properties for testing");
   
    //-- For debugging purposes only, used by TE_TelWatchers(Unit).

    //- this property change (to any value) informs that CTelPhoneWatcher has re-read modem table from commdb in
    //- CTelPhoneWatcher::DoRetrieveTSYNameL(). 
    RProperty::Define(KUidSystemCategory, KUidTestProp_ModemTableRefreshed.iUid, RProperty::EInt);  
  
    //- this property changes in CTelPhoneWatcher::HandleModemChangedL()
    //- when the commsdb modem record has changed
    RProperty::Define(KUidSystemCategory, KUidTestProp_ModemRecordChanged.iUid, RProperty::EInt);
    
    //-- this property is used in CIndicatorWatcher::HandleIndicatorUpdateL()
    //-- to simulate call state change by t_watchers test
    RProperty::Define(KUidSystemCategory, KUidTestProp_CallStateChange.iUid, RProperty::EInt);

    //-- this property is used to disable and reset phone watchers
    RProperty::Define(KUidSystemCategory, KUidTestProp_WatchersDisable.iUid, RProperty::EInt);    
#endif
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:32,代码来源:watcherbase.cpp

示例12: iRandSeed

CTestAppUi::CTestAppUi()
	: iRandSeed(KRandSeed)
	{
	TTime time;
	time.HomeTime();
	iRandSeed=time.Int64();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:7,代码来源:tview2.CPP

示例13: Random

// MceSip::Random
// -----------------------------------------------------------------------------
// 
TUint MceSip::Random( TUint aMinValue, TUint aMaxValue )
    {
    TUint randomValue( aMinValue <= aMaxValue ? aMinValue : 0 );
    
    if ( aMinValue <= aMaxValue )
        {
        
        TTime time;
        time.HomeTime();
        TInt64 seed( time.Int64() );

        
        for ( TUint i = 0; i < ( aMaxValue - aMinValue ); i++ )
            {
            TInt random = Math::Rand( seed );
            TReal random2 =  ( TReal )random / KMceRandDividerOne;
            TUint random3 = ( TUint )( aMaxValue * random2 ) /
            KMceRandDividerTwo;

            if ( aMinValue <= random3 && aMaxValue >= random3 )
                {
                randomValue = random3;
                break;
                }
            }
        }
        
    return randomValue;
    
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:33,代码来源:mcesip.cpp

示例14:

// ---------------------------------------------------------
// CT_LbsInstallPsyTp273::NotifyPositionUpdate
// 
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsInstallPsyTp273::NotifyPositionUpdate(
	TPositionInfoBase& aPosInfo,
    TRequestStatus& aStatus)
	{
	TInt err = KErrNone;
    
    TTime tt;
    tt.UniversalTime();
    //Request ID must be unique, use universalime as seed
    // to give a random number
    TInt64 seed = tt.Int64();
    TReal lat = 90 * Math::FRand(seed);
    TReal lon = 90 * Math::FRand(seed);
    TReal32 alt = (TReal32)(90 * Math::FRand(seed));
    TPositionInfo* position = static_cast<TPositionInfo*> (&aPosInfo);
    TUid implUid = { KPosImplementationUid };
    position->SetModuleId(implUid);

    TTime now;
    now.UniversalTime();          

    TPosition posse;
    posse.SetCoordinate(lat, lon, alt);
    posse.SetTime(now);
    position->SetPosition(posse);

    TRequestStatus* status = &aStatus;
	User::RequestComplete(status, err);
    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:35,代码来源:ctlbsinstallpsytp273.cpp

示例15: RunTestL

// -----------------------------------------------------------------------------
// CTFTestCaseRepeater::RunTestL
// -----------------------------------------------------------------------------
void CTFTestCaseRepeater::RunTestL( void )
    {
    COMPONENT_TRACE( ( _L( "    DSYTESTTOOL - CTFTestCaseRepeater::RunTestL()" ) ) );
    if ( iSuite != NULL )
        {
        RHeap& heap = User::Heap();
        TInt heapSizeStart = 0;
        TInt heapCountStart = 0;
        TInt err;
        heapCountStart = heap.AllocSize( heapSizeStart );
        if ( iRandomRepeat )
            {
            TTime time;
            time.HomeTime();
            TInt64 seed = time.Int64();
            for ( TInt i = 0; i < iRepeatCount; i++ )
                {
                TInt index = Math::Rand( seed ) % iSuite->Count();
                CTFATest& test = iSuite->At( index );
                // The test suites and repeater test cases are not run
                if ( test.Type() != ETFTestTypeStubRepeater && test.Type() != ETFATestTypeSuite )
                    {
                    STATIC_CAST( CTFATestCase*, &test )->SetupL();
                    TRAP( err, STATIC_CAST( CTFATestCase*, &test )->RunTestL() );
                    STATIC_CAST( CTFATestCase*, &test )->Teardown();
                    User::LeaveIfError( err );
                    }
                else
                    {
                    i--;
                    }
                }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:35,代码来源:tftestcaserepeater.cpp


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