本文整理汇总了C++中TTimeIntervalMicroSeconds::Int64方法的典型用法代码示例。如果您正苦于以下问题:C++ TTimeIntervalMicroSeconds::Int64方法的具体用法?C++ TTimeIntervalMicroSeconds::Int64怎么用?C++ TTimeIntervalMicroSeconds::Int64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTimeIntervalMicroSeconds
的用法示例。
在下文中一共展示了TTimeIntervalMicroSeconds::Int64方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mediaIdAudio
void UT_CG711PayloadFormatWrite::UT_CG711PayloadFormatWrite_FrameTimeIntervalL( )
{
//iWrite->iFrameTimeInterval = 20000 * 2; // 20k * Channels
TTimeIntervalMicroSeconds catchAfish;
TMediaId mediaIdAudio( KUidMediaTypeAudio, 1 );
TMediaId mediaIdVideo( KUidMediaTypeVideo, 1 );
if ( !iAlloc )
{
catchAfish = iWrite->FrameTimeInterval ( mediaIdAudio );
EUNIT_ASSERT_EQUALS( catchAfish.Int64(), 0 );
catchAfish = iWrite->FrameTimeInterval ( mediaIdVideo );
EUNIT_ASSERT_EQUALS( catchAfish.Int64(), 0 );
}
else
{
EUNIT_ASSERT_NO_LEAVE( iWrite->FrameTimeInterval ( mediaIdAudio ) );
EUNIT_ASSERT_NO_LEAVE( iWrite->FrameTimeInterval ( mediaIdVideo ) );
}
}
示例2: Configure
// ---------------------------------------------------------------------------
// Configures the flex window sizes for both the initial delay and the
// consequent intervals after that. 64-bit version.
// ---------------------------------------------------------------------------
//
EXPORT_C TInt CFlexPeriodic::Configure(
TTimeIntervalMicroSeconds aDelayWindow,
TTimeIntervalMicroSeconds aIntervalWindow )
{
OstTraceExt3( TRACE_NORMAL, DUP1_CFLEXPERIODIC_CONFIGURE,
"CFlexPeriodic::Configure64;this=%x;"
"aDelayWindow=%lld;aIntervalWindow=%lld", ( TUint )this,
aDelayWindow.Int64(), aIntervalWindow.Int64() );
TTimeIntervalMicroSeconds zero( 0 );
__ASSERT_ALWAYS(aDelayWindow >= zero,
User::Panic(KCFlexPeriodicPanicCat,
EFlexPeriodicDelayWindowLessThanZero));
__ASSERT_ALWAYS(aIntervalWindow >= zero,
User::Panic(KCFlexPeriodicPanicCat,
EFlexPeriodicIntervalWindowLessThanZero));
// interval window is saved for later use. Delay window is sent
// immediately to server.
TInt ret = CFlexTimer::Configure( aDelayWindow );
if ( ret == KErrNone )
{
// Interval window is changed only, if configuration is successful.
iIntervalWindow = aIntervalWindow;
// This is set to true only, if the server is able to receive the
// delay window configuration.
iSendConfigure = ETrue;
}
return ret;
}
示例3: Start
// ---------------------------------------------------------------------------
// Starts the periodic timer. 64-bit delay and interval parameters.
// ---------------------------------------------------------------------------
//
EXPORT_C void CFlexPeriodic::Start( TTimeIntervalMicroSeconds aDelay,
TTimeIntervalMicroSeconds anInterval,
TCallBack aCallBack,
TCallBack aCallBackError )
{
OstTraceExt4( TRACE_NORMAL, CFLEXPERIODIC_START64,
"CFlexPeriodic::Start64;this=%x;aDelay=%lld;"
"anInterval=%lld;aCallBack=%x", ( TUint )this,
aDelay.Int64(), anInterval.Int64(), ( TUint )&( aCallBack ) );
TTimeIntervalMicroSeconds zero( 0 );
__ASSERT_ALWAYS(aDelay >= zero,
User::Panic(KCFlexPeriodicPanicCat,
EFlexPeriodicDelayLessThanZero));
__ASSERT_ALWAYS(anInterval > zero,
User::Panic(KCFlexPeriodicPanicCat,
EFlexPeriodicIntervalTooSmall));
__ASSERT_ALWAYS( aCallBack.iFunction != NULL,
User::Panic(KCFlexPeriodicPanicCat,
EFlexPeriodicCallbackFunctionIsNull));
// aCallBackError is left unasserted on purpose.
// if error occurs and callback is null client is paniced.
// Interval value is saved for later use, delay is sent immediately
// to the server.
iInterval = anInterval.Int64();
iCallBack = aCallBack;
iCallBackError = aCallBackError;
CFlexTimer::After( aDelay );
}
示例4: GetPlayPos
virtual dword GetPlayPos() const{
if(!inited)
return 0;
if(finished)
return GetPlayTime();
dword ret;
#ifdef USE_OPTIONAL_POSITIONING
const_cast<C_simple_sound_player_imp*>(this)->InitLib();
if(mca_GetPosition){
TTimeIntervalMicroSeconds p;
#ifdef _DEBUG
(plr->*mca_GetPosition)(p);
#else
mca_GetPosition(plr, p);
#endif
ret = (p.Int64()/TInt64(1000)).Low();
}else
ret = 0;
#else
TTimeIntervalMicroSeconds p;
plr->GetPosition(p);
ret = dword(p.Int64()/TInt64(1000));
#endif
return Min(ret, GetPlayTime());
}
示例5: gf_sys_get_rti
/*CPU and Memory Usage*/
GF_EXPORT
Bool gf_sys_get_rti(u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags)
{
TInt ram, ram_free;
u32 now, time;
#ifdef __SERIES60_3X__
TModuleMemoryInfo mi;
#endif
TTimeIntervalMicroSeconds tims;
RProcess cur_process;
RThread cur_th;
now = gf_sys_clock();
if (!rti->sampling_instant) {
rti->sampling_instant = now;
if (cur_th.GetCpuTime(tims) != KErrNone) {
return 0;
}
#ifdef __SERIES60_3X__
rti->process_cpu_time = (u32) (tims.Int64() / 1000);
#else
rti->process_cpu_time = (u32) ( TInt64(tims.Int64() / 1000).GetTInt() );
#endif
return 0;
}
if (rti->sampling_instant + refresh_time_ms > now) return 0;
rti->sampling_period_duration = now - rti->sampling_instant;
rti->sampling_instant = now;
if (cur_th.Process(cur_process) != KErrNone) {
return 0;
}
#ifdef __SERIES60_3X__
if (cur_process.GetMemoryInfo(mi) != KErrNone) {
return 0;
}
rti->process_memory = mi.iCodeSize + mi.iConstDataSize + mi.iInitialisedDataSize + mi.iUninitialisedDataSize;
#endif
if (cur_th.GetCpuTime(tims) != KErrNone) {
return 0;
}
#ifdef __SERIES60_3X__
time = (u32) (tims.Int64() / 1000);
#else
time = (u32) ( TInt64(tims.Int64() / 1000).GetTInt() );
#endif
rti->process_cpu_time_diff = time - rti->process_cpu_time;
rti->process_cpu_time = time;
rti->process_cpu_usage = 100*rti->process_cpu_time_diff / rti->sampling_period_duration;
if (rti->process_cpu_usage > 100) rti->process_cpu_usage = 100;
HAL::Get(HALData::EMemoryRAM, ram);
HAL::Get(HALData::EMemoryRAMFree, ram_free);
rti->physical_memory = ram;
rti->physical_memory_avail = ram_free;
#ifdef GPAC_MEMORY_TRACKING
rti->gpac_memory = gpac_allocated_memory;
#endif
return 1;
}
示例6: 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;
}
}
示例7: TestBootupPerformanceL
void CTzBootPerformanceTest::TestBootupPerformanceL()
{
TTime startTime;
TTime endTime;
startTime.UniversalTime();
RTz tz;
User::LeaveIfError(tz.Connect());
endTime.UniversalTime();
tz.Close();
TTimeIntervalMicroSeconds micros = endTime.MicroSecondsFrom(startTime);
_LIT(KBootTime, "Time to connect time zone server = %d (ms) \n");
test.Printf(KBootTime,micros);
#ifndef __WINS__
#ifdef GetPerformanceBaseline
bootTimeBaseLine = micros.Int64();
_LIT(KBootTimeBaseLine, "The baseline of boot-up time = %d (ms) \n");
test.Printf(KBootTimeBaseLine,bootTimeBaseLine);
#else
test((micros.Int64()-bootTimeBaseLine)/bootTimeBaseLine<0.1);
#endif
#endif
}
示例8: LocationUpdate
/** Adjusts system time if required. The decision whether the adjustment is needed or not
is based on the following criterias:
- satellite time must be present in the location update
- time threshold must be exceeded
- time from a last adjustment is greater than a defined interval.
@param aStatus An error code.
@param TPositionSatelliteInfo Position and time information.
If clock adjustment takes place the TPosition::iTime is
re-set to the satellite time.
@see CLbsAdmin
@see TPositionSatelliteInfo
*/
void CAutoClockAdjust::LocationUpdate(TInt aStatus, TPositionSatelliteInfo& aPosInfo)
{
LBSLOG(ELogP1, "CAutoClockAdjust::LocationUpdate()\n");
TTimeIntervalMicroSeconds timeCorr;
TTime sysTime;
TInt err;
// If adjustment on, no error, and satellite information present
if ((iClockAdjustSetting == CLbsAdmin::EClockAdjustOn) && (aStatus == KErrNone) &&
((aPosInfo.PositionClassType() & EPositionSatelliteInfoClass) == EPositionSatelliteInfoClass))
{
// Is is time do do another time adjustment?
sysTime.UniversalTime();
if (Abs(sysTime.MicroSecondsFrom(iLastAdjustment).Int64()) > (1000*iAdjustInterval))
{
const TPositionSatelliteInfo& satInfo = static_cast<const TPositionSatelliteInfo&>(aPosInfo);
err = CalculateTimeCorrection(satInfo, timeCorr);
if (err == KErrNone)
{
// Is threshold exceeded?
if (Abs(timeCorr.Int64()) > (1000*iAdjustThreshold))
{
sysTime.UniversalTime();
sysTime += timeCorr;
LBSLOG(ELogP9, "->S CGpsSetClockBase::SetUTCTime() ClockModule\n");
LBSLOG5(ELogP9, " > TTime sysTime = %02d:%02d:%02d.%06d\n", sysTime.DateTime().Hour(),
sysTime.DateTime().Minute(),
sysTime.DateTime().Second(),
sysTime.DateTime().MicroSecond());
err = iSetClockImpl->SetUTCTime(sysTime);
LBSLOG2(ELogP9, " Return = %d\n", err);
if (err == KErrNone)
{
// Sync the position time with the satellite time
// to avoid re-adjusting the system time by the manual clock adjustment component.
TPosition pos;
aPosInfo.GetPosition(pos);
pos.SetTime(aPosInfo.SatelliteTime());
aPosInfo.SetPosition(pos);
LBSLOG2(ELogP2, "ACTION: Clock Adjusted by %ld\n", timeCorr.Int64());
}
}
if (err == KErrNone)
{
// Remember the current time even if threshold not exceeded
iLastAdjustment = sysTime;
}
else
{
LBSLOG_WARN2(ELogP3, "Clock Adjustment failed. Error: %d\n", err);
}
}
}
}
}
示例9:
// ---------------------------------------------------------
// ---------------------------------------------------------
//
void CPosTp143::CheckCountersL()
{
iLog->Log(_L("CheckCountersL"));
TTime start, end;
CPosLandmarkDatabaseExtended* dbExt = CPosLandmarkDatabaseExtended::OpenL();
CleanupStack::PushL(dbExt);
iLog->Log(_L("checking LandmarksCount"));
start.UniversalTime();
TInt lmCount = dbExt->LandmarksCount();
end.UniversalTime();
TTimeIntervalMicroSeconds interval = end.MicroSecondsFrom( start );
iLog->Log(_L("LandmarksCount done in %ld us"), interval.Int64());
if ( lmCount != iLandmarks.Count() )
{
iLog->Log( _L("LandmarksCount wrong result, expected %d, actual %d"),
iLandmarks.Count(), lmCount );
User::Leave( KErrGeneral );
}
CPosLmItemIterator* iter = iDatabase->LandmarkIteratorL();
CleanupStack::PushL(iter);
if ( lmCount != iter->NumOfItemsL() )
{
iLog->Log( _L("CategoriesCount wrong result, expected %d, actual %d"),
iter->NumOfItemsL(), lmCount );
User::Leave( KErrGeneral );
}
CleanupStack::PopAndDestroy( iter );
iLog->Log(_L("checking CategoriesCount"));
start.UniversalTime();
TInt catCount = dbExt->CategoriesCount();
end.UniversalTime();
interval = end.MicroSecondsFrom( start );
iLog->Log(_L("CategoriesCount done in %ld us"), interval.Int64());
CPosLmCategoryManager& catman = dbExt->CategoryManager();
CPosLmItemIterator* catIter = catman.CategoryIteratorL();
CleanupStack::PushL(catIter);
if ( catCount != catIter->NumOfItemsL() )
{
iLog->Log( _L("CategoriesCount wrong result, expected %d, actual %d"),
catIter->NumOfItemsL(), catCount );
User::Leave( KErrGeneral );
}
CleanupStack::PopAndDestroy( catIter );
CleanupStack::PopAndDestroy( dbExt );
}
示例10: CalculateTimeToNextFlash
TTimeIntervalMicroSeconds CWsSpriteManager::CalculateTimeToNextFlash(TTimeIntervalMicroSeconds aTime) const
{
TInt64 nextStateChange;
if(aTime<KFlashHalfSecond)
nextStateChange=KFlashHalfSecond-aTime.Int64();
else
nextStateChange=KFlashHalfSecond - (aTime.Int64() - KFlashHalfSecond);
ASSERT(nextStateChange > 0);
return TTimeIntervalMicroSeconds(nextStateChange);
}
示例11: DataPosition
EXPORT_C TUint DataPosition(TTimeIntervalMicroSeconds aPosition,
TTimeIntervalMicroSeconds aFrameTime,
TUint aFrameLength)
{
TInt64 dataPosition64(0);
if(aFrameTime.Int64() != 0)
dataPosition64 = aPosition.Int64() * aFrameLength / aFrameTime.Int64() ;
return I64INT(dataPosition64);
}
示例12: Panic
void CMMFDataPath2::FillSourceBufferL()
{
__ASSERT_DEBUG((iState == EPlaying || iState == EConverting || iState == ERecording || (iState == EPrimed && iPauseCalled && iIsUsingResumeSupport) ), Panic(EMMFDataPathPanicBadState,__LINE__));
//if the silence timer is active then dont propagate the request
if(iRepeatTrailingSilenceTimer->IsActive())
{
return;
}
//play the silence period and dont propagate the request
if(iTrailingSilenceLeftToPlay>0 || iVerifyPlayComplete)
{
if(iVerifyPlayComplete)//case when the trailing silence is zero
{
if (!*iDisableAutoIntent && iDrmSource)
{
CMMFFile* file = static_cast<CMMFFile*>(iDrmSource);
TInt err = file->ExecuteIntent(ContentAccess::EPlay);
if (err != KErrNone)
{
DoSendEventToClient(KMMFEventCategoryPlaybackComplete, err);
return;
}
}
//Retrieve the current play time and add "duration-currentplaytime" to the silence period
//This is to ensure that silence timer is not started before the previous play is actually completed by the devsound
TTimeIntervalMicroSeconds currentTime = CalculateAudioOutputPosition();
if(currentTime.Int64()>iPlayWindowStartPosition.Int64())
{
iTimeLeftToPlayComplete = iPlayWindowEndPosition.Int64()-currentTime.Int64();
}
else
{
iTimeLeftToPlayComplete = 0;
}
iVerifyPlayComplete = EFalse;
}
if(iTrailingSilenceLeftToPlay==0 && iTimeLeftToPlayComplete==0)
{
SetPositionL(iPlayWindowStartPosition);
iTimeLeftToPlayComplete=-1;
}
else
{
PlaySilence();
return;
}
}
DoFillSourceBufferL();
}
示例13: file
static void PerformanceTest2L()
{
test.Printf(_L("\nHuge Ini file(684Kb) performance test\n"));
//This test will try finding values within different section in the ini file, beginning
//middle and end of the file.
//Light weight testing
TTime startTime, stopTime;
TPtrC16 value;
startTime.UniversalTime();
for (TInt i=0;i<1;i++)
{
CIniFile16* ini=CIniFile16::NewL(TheRFs,_L("z:\\resource\\big16.ini"));
test(ini->FindVar(_L("Secure_DB_Backup"),_L("source"),value)==KErrNone);
test(value.Compare(_L("C:\\private\\100012a5\\DBS_100065FF_performance.cdb"))==0);
test(ini->FindVar(_L("20701_AddEntries"),_L("firstname430"),value)==KErrNone);
test(value.Compare(_L("Husham"))==0);
test(ini->FindVar(_L("20701_AddEntries"),_L("homemobile514"),value)==KErrNone);
test(value.Compare(_L("07763 222730"))==0);
test(ini->FindVar(_L("20701_AddEntries"),_L("dummyI830"),value)==KErrNone);
test(value.Compare(_L(""))==0);
test(ini->FindVar(_L("20701_AddEntries"),_L("workemail1066"),value)==KErrNone);
test(value.Compare(_L("[email protected]"))==0);
delete ini;
}
stopTime.UniversalTime();
TTimeIntervalMicroSeconds timeTaken = stopTime.MicroSecondsFrom(startTime);
test.Printf(_L("Time taken for Light= %d microseconds\n"), timeTaken.Int64() );
//heavy weight testing
startTime.UniversalTime();
for (TInt j=0;j<1;j++)
{
CIniDocument16* dom=CIniDocument16::NewL(TheRFs,_L("z:\\resource\\big16.ini"));
test(dom->GetKeyValue(_L("Secure_DB_Backup"),_L("source"),value)==KErrNone);
test(value.Compare(_L("C:\\private\\100012a5\\DBS_100065FF_performance.cdb"))==0);
test(dom->GetKeyValue(_L("20701_AddEntries"),_L("firstname430"),value)==KErrNone);
test(value.Compare(_L("Husham"))==0);
test(dom->GetKeyValue(_L("20701_AddEntries"),_L("homemobile514"),value)==KErrNone);
test(value.Compare(_L("07763 222730"))==0);
test(dom->GetKeyValue(_L("20701_AddEntries"),_L("dummyI830"),value)==KErrNone);
test(value.Compare(_L(""))==0);
test(dom->GetKeyValue(_L("20701_AddEntries"),_L("workemail1066"),value)==KErrNone);
test(value.Compare(_L("[email protected]"))==0);
delete dom;
}
stopTime.UniversalTime();
timeTaken = stopTime.MicroSecondsFrom(startTime);
test.Printf(_L("Time taken for Heavy= %d microseconds\n"), timeTaken.Int64() );
}
示例14: DoPacket
void CProtocolExadump::DoPacket(const RMBufPacketBase &aPacket, const RMBufPktInfo &aInfo)
/**
* Dump the packet.
*
* This is called for both incoming and outgoing packets, from the
* respective ApplyL methods.
*
* @param aPacket The packet data
* @param aInfo The packet inforrmation
*/
{
/** @code */
// Open the dump file, if not already opened (or attempted).
if (iOpen == 0)
DoOpen(1500);
if (iOpen < 0)
return; // cannot open output file.
//
// Build PCAP frame into iBuffer (pcap_pkthdr + snapped portion of the packet)
//
TPtr8 buf = iBuffer->Des();
struct pcap_pkthdr *const hdr = (struct pcap_pkthdr *)buf.Ptr();
TPtr8 ptr((TUint8 *)buf.Ptr() + sizeof(*hdr), buf.MaxLength() - sizeof(*hdr));
const TInt snap = aInfo.iLength > ptr.MaxLength() ? ptr.MaxLength() : aInfo.iLength;
ptr.SetLength(snap);
aPacket.CopyOut(ptr);
hdr->caplen = snap;
hdr->len = aInfo.iLength;
TTime stamp;
stamp.UniversalTime();
const TTimeIntervalMicroSeconds elapsed = stamp.MicroSecondsFrom(iBase);
#ifdef I64INT
hdr->ts.tv_usec = I64INT(elapsed.Int64() % 1000000);
hdr->ts.tv_sec = I64INT(elapsed.Int64() / 1000000);
#else
hdr->ts.tv_usec = (elapsed.Int64() % 1000000).GetTInt();
hdr->ts.tv_sec = (elapsed.Int64() / 1000000).GetTInt();
#endif
//
// Write frame out.
//
iDumpFile.Write(buf, snap+sizeof(*hdr));
/** @endcode */
}
示例15: UpdateTimeStamp
void CCopyContactsAO::UpdateTimeStamp()
{
RFs fs;
fs.Connect();
TBuf<256> cdbFileName; // Contact db file name
if (iDatabase->FindContactFile(cdbFileName)) {
TTime cdbTime;
fs.Modified(cdbFileName, cdbTime);
TDateTime janNineteenSeventy
(1970,EJanuary,0,00,00,00,000000);
TTime timejan(janNineteenSeventy);
TTimeIntervalMicroSeconds interval =
cdbTime.MicroSecondsFrom(timejan);
TInt64 cdbVal;
cdbVal = interval.Int64()/1000;
TBuf<256> timestamp;
timestamp.Num(cdbVal);
iAppUi.AddTimeStampToFileL(×tamp);
}
fs.Close();
}