本文整理汇总了C++中TDateTime::MicroSecond方法的典型用法代码示例。如果您正苦于以下问题:C++ TDateTime::MicroSecond方法的具体用法?C++ TDateTime::MicroSecond怎么用?C++ TDateTime::MicroSecond使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDateTime
的用法示例。
在下文中一共展示了TDateTime::MicroSecond方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompareDate
TBool CHttpHdrTest::CompareDate(TDateTime aDate1, TDateTime aDate2)
{
return ((aDate1.Year() == aDate2.Year()) &&
(aDate1.Month() == aDate2.Month()) &&
(aDate1.Day() == aDate2.Day()) &&
(aDate1.Hour() == aDate2.Hour()) &&
(aDate1.Minute() == aDate2.Minute()) &&
(aDate1.Second() == aDate2.Second()) &&
(aDate1.MicroSecond() == aDate2.MicroSecond()));
}
示例2: LogDateTime
// ---------------------------------------------------------------------------
// TPresCondValidity::LogDateTime()
// ---------------------------------------------------------------------------
//
void TPresCondValidity::LogDateTime(TDateTime aDateTime)
{
OPENG_DP(D_OPENG_LIT( " %d, %d, %d, %d, %d, %d, %d"),
aDateTime.Year(), aDateTime.Month()+1, aDateTime.Day()+1,
aDateTime.Hour(), aDateTime.Minute(), aDateTime.Second(),
aDateTime.MicroSecond() );
}
示例3: Debug
GLDEF_C void Debug( TRefByValue<const TDesC> aText, ... )
{
#ifdef WINS
VA_LIST args;
VA_START( args, aText );
TBuf<KLogLineLength> buf;
buf.FormatList( aText, args );
RFileLogger logger;
TInt ret=logger.Connect();
if (ret==KErrNone)
{
logger.SetDateAndTime( EFalse,EFalse );
logger.CreateLog( KLogFolder, KLogFileName, EFileLoggingModeAppend );
TBuf<KLogTimeFormatLength> timeStamp;
TTime now;
now.HomeTime();
TDateTime dateTime;
dateTime = now.DateTime();
timeStamp.Format( KLogTimeFormat,
dateTime.Hour(), dateTime.Minute(),
dateTime.Second(), dateTime.MicroSecond() );
buf.Insert( 0, timeStamp );
logger.Write(buf);
}
logger.Close();
VA_END( args );
#else
RDebug::Print(aText);
#endif
}
示例4: difftime
CIpuTestHarness::~CIpuTestHarness()
//
// D'tor
{
TTime endtime;
endtime.UniversalTime();
// Do resource handle leak test?
if (iDoResourceLeakTest)
ResourceLeakTest();
// End of tests - see if failed or ok
if (iFailedTests->Count())
{
TestHarnessFailed();
}
else
{
TestHarnessComplete();
}
iFailedTests->ResetAndDestroy();
delete iFailedTests;
// Log finish time
TDateTime t = endtime.DateTime();
LogIt(_L("Ended @ %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
TTime difftime(endtime.Int64() - iStartTime.Int64());
t = difftime.DateTime();
LogIt(_L("Execution time %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
// Close logs and test harness
iFlogger.CloseLog();
// iTest test harness performs UHEAP MARK/UNMARK check upon creation/destruction
// therefore, it must be destroyed last since it is created first in
// CIpuTestHarness
iTest.Close();
}
示例5: ConstructL
void CIpuTestHarness::ConstructL(const TDesC& aTitle)
//
// Non-trivial c'tor
{
// Create iFailedTests
iFailedTests = new (ELeave) CArrayPtrFlat<CTestInfo> (KFailedTestsGranularity);
// Start up logging server connection
TBuf<64> temp(aTitle);
DefaultLogFileName(temp);
CreateFlogger(temp, EFalse, EFalse);
iStartTime.UniversalTime();
TDateTime t = iStartTime.DateTime();
LogIt(_L("Started @ %d:%d:%d:%d"),t.Hour(),t.Minute(),t.Second(),t.MicroSecond());
// Find number of open resource handles
TInt processHandleCount=0;
RThread().HandleCount(processHandleCount,iStartHandleCount);
}
示例6: PrintCurrentTimeStamp
void CTe_RegConcurrentTestStepBase::PrintCurrentTimeStamp(TBool aStart)
{
TTime time;
time.UniversalTime();
TDateTime dateTime = time.DateTime();
TBuf<32> timeBuf;
timeBuf.Format(_L("%02d:%02d:%02d:%03d"), dateTime.Hour(), dateTime.Minute(), dateTime.Second(), dateTime.MicroSecond());
TBuf<16> buf(aStart?_L("started"):_L("ended"));
_LIT(KTimeFormat, "%S in server %S %S at %S");
INFO_PRINTF5(KTimeFormat, &ConfigSection(), &GetServerName(), &buf, &timeBuf);
}
示例7: AddTime
void CSerialWriter::AddTime(TDes8& aLogBuffer)
{
TTime now;
now.UniversalTime();
TDateTime dateTime = now.DateTime();
_LIT8(KFormat,"%02d:%02d:%02d:%03d ");
// add the current time
aLogBuffer.Append(KTEFNewLine) ;
aLogBuffer.AppendFormat(KFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),(dateTime.MicroSecond()/1000));
}
示例8: PrintfDateTimeToDebugLog
// print a date and time to log in a readable format:
void LbsTestUtilities::PrintfDateTimeToDebugLog(TTime aTime)
{
TDateTime datetime = aTime.DateTime();
TESTLOG8(ELogP2,"%d :%d :%d :%d on %d/%d/%d", datetime.Hour(), datetime.Minute(), datetime.Second(), datetime.MicroSecond(), datetime.Day() + 1, datetime.Month() + 1, datetime.Year());
}
示例9: MakeTimeStrMilli
void TAzenqosEngineUtils::MakeTimeStrMilli(TTime &time,TDes& str) //str should be at least 19 in length
{
const TInt KThousand = 1000;
TDateTime date = time.DateTime();
str.Format(KTimeStampMillisecFormat,date.Year()%2000,date.Month()+1,date.Day()+1,date.Hour(),date.Minute(),date.Second(),date.MicroSecond()*KThousand);
}
示例10: WriteRecord
void CDTSYLogger::WriteRecord(const TDesC8& aText)
{
if(iValid)
{
TBuf8<KGenericBufferSize> buf;
TTime now;
now.UniversalTime();
TDateTime dateTime;
dateTime = now.DateTime();
buf.Format(_L8 ("%04d/%02d/%02d %02d.%02d:%02d:%06d "),dateTime.Year(),dateTime.Month()+1, dateTime.Day()+1,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
buf.AppendFormat(_L8("%S\015\012"),&aText);
iFile.Write(buf);
iFile.Flush();
}
}
示例11: store_authentication_timeL
void eap_am_type_securid_symbian_c::store_authentication_timeL()
{
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT);
EAP_TRACE_DEBUG(m_am_tools,
TRACE_FLAGS_DEFAULT, (
EAPL("eap_am_type_securid_symbian_c::store_authentication_timeL: EAP-tunneling type=0xfe%06x%08x\n"),
m_tunneling_type.get_vendor_id(),
m_tunneling_type.get_vendor_type()));
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength);
TPtr sqlStatement = buf->Des();
// Query all the relevant parameters
_LIT(KSQLQuery, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d");
if (m_eap_type == eap_type_generic_token_card)
{
sqlStatement.Format(
KSQLQuery,
&KGTCLastFullAuthTime,
&KGtcTableName,
&KServiceType,
m_index_type,
&KServiceIndex,
m_index,
&KTunnelingTypeVendorId,
m_tunneling_type.get_vendor_id(),
&KTunnelingType,
m_tunneling_type.get_vendor_type());
}
else
{
// Secure ID is not supported at the moment.
// Leave with error.
CleanupStack::PopAndDestroy(buf); // Delete buf.
User::Leave(KErrNotSupported);
}
RDbView view;
// Evaluate view
User::LeaveIfError(view.Prepare(m_database, TDbQuery(sqlStatement), TDbWindow::EUnlimited));
CleanupClosePushL(view);
User::LeaveIfError(view.EvaluateAll());
// Get the first (and only) row for updation.
view.FirstL();
view.UpdateL();
// Get column set so we get the correct column numbers
CDbColSet* colSet = view.ColSetL();
CleanupStack::PushL(colSet);
// Get the current universal time.
TTime currentTime;
currentTime.UniversalTime();
#if defined(_DEBUG) || defined(DEBUG)
TDateTime currentDateTime = currentTime.DateTime();
EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT,
(EAPL("eap_am_type_securid_symbian_c::store_authentication_time, %2d-%2d-%4d : %2d-%2d-%2d-%d\n"),
currentDateTime.Day()+1, currentDateTime.Month()+1,currentDateTime.Year(), currentDateTime.Hour(),
currentDateTime.Minute(), currentDateTime.Second(), currentDateTime.MicroSecond()));
#endif
TInt64 fullAuthTime = currentTime.Int64();
view.SetColL(colSet->ColNo(KGTCLastFullAuthTime), fullAuthTime);
view.PutL();
CleanupStack::PopAndDestroy(colSet); // Delete colSet.
CleanupStack::PopAndDestroy(&view); // Close view.
CleanupStack::PopAndDestroy(buf); // Delete buf.
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
}
示例12: doTestStepL
TVerdict CAppFwkStartSafeTestStepProcMonSysRestart::doTestStepL()
{
#ifdef __WINSCW__
ASSERT(0);
#endif
CActiveScheduler* sched = new(ELeave) CActiveScheduler;
CleanupStack::PushL(sched);
CActiveScheduler::Install(sched);
iNotifier = CSaveNotifier::NewL(*this);
CStartSafe* startSafe = CStartSafe::NewL();
CleanupStack::PushL( startSafe );
CStartupProperties* prop = CStartupProperties::NewLC();
prop->SetFileParamsL(KTestProcGood, KNullDesC);
prop->SetStartMethod(EWaitForStart);
prop->SetMonitored(ETrue);
prop->SetRecoveryParams(ERestartOS, 0);
TInt tried;
RProcess proc;
CleanupClosePushL(proc);
TRAPD(err, startSafe->StartAndMonitorL(*prop, proc, tried));
TEST(KErrNone == err);
CleanupStack::Pop(&proc);
CleanupStack::PopAndDestroy(prop);
CleanupStack::PopAndDestroy(startSafe);
INFO_PRINTF1(_L("Process monitoring setup with TRecoveryMethod=ERestartOS"));
proc.Kill(KErrNone);
proc.Close();
TTime init;
init.UniversalTime();
INFO_PRINTF4( _L("Process killed at time %d:%d.%d"), init.DateTime().Minute(), init.DateTime().Second(), init.DateTime().MicroSecond());
INFO_PRINTF1(_L("Starting scheduler (expecting an OS restart)"));
CActiveScheduler::Start(); //Wait for MSaveObserver callback
//resume here after callback has stopped the scheduler
TESTE(iCallbackReceived, iCallbackReceived);
if(iCallbackReceived)
{
const TTimeIntervalMicroSeconds elapsedTime = iShutdownPerformed.MicroSecondsFrom(init);
const TDateTime dt = iShutdownPerformed.DateTime();
const TInt64 value = elapsedTime.Int64();
INFO_PRINTF5(_L("Shutdown callback received at time %d:%d.%d (after %d microseconds)"), dt.Minute(), dt.Second(), dt.MicroSecond(), value);
TESTE((value >= 0) && (value < 1000000), value); // within 1 second
}
else
{
INFO_PRINTF1( _L("Restart didn't take place :-("));
TEST(EFalse);
}
// Now call CPowerdownClient::QueryServerPowerState() which will in turn call the method 'ServerPowerState()'
// to stop the shutdown. This function call will cause the shutdown server in syslibs/pwrcli to cancel power off.
INFO_PRINTF1(_L("Aborting shutdown."));
TBool powerOff = EFalse;
CPowerdownClient* powerdownclient = CPowerdownClient::NewL();
CleanupStack::PushL(powerdownclient);
TEST(KErrNone == powerdownclient->QueryServerPowerState(iNotifier,powerOff));
TEST(powerOff);
CleanupStack::PopAndDestroy(powerdownclient);
CleanupStack::PopAndDestroy(sched);
return TestStepResult();
}
示例13: dt
void PsyUtils::TPositionInfo2QGeoPositionInfo(TPositionInfoBase &aPosInfoBase, QGeoPositionInfo& aQPosInfo)
{
if (aPosInfoBase.PositionClassType() & EPositionInfoClass ||
aPosInfoBase.PositionClassType() & EPositionSatelliteInfoClass) {
TPositionInfo *posInfo = static_cast<TPositionInfo*>(&aPosInfoBase);
TPosition pos;
QGeoCoordinate coord;
posInfo->GetPosition(pos);
coord.setLatitude(pos.Latitude());
coord.setLongitude(pos.Longitude());
coord.setAltitude(pos.Altitude());
//store the QGeoCoordinate values
aQPosInfo.setCoordinate(coord);
TDateTime datetime = pos.Time().DateTime();
QDateTime dt(QDate(datetime.Year() , datetime.Month() + 1, datetime.Day() + 1),
QTime(datetime.Hour() , datetime.Minute(), datetime.Second(),
datetime.MicroSecond() / 1000),
Qt::UTC);
//store the time stamp
aQPosInfo.setTimestamp(dt);
//store the horizontal accuracy
aQPosInfo.setAttribute(QGeoPositionInfo::HorizontalAccuracy, pos.HorizontalAccuracy());
//store the vertical accuracy
aQPosInfo.setAttribute(QGeoPositionInfo::VerticalAccuracy, pos.VerticalAccuracy());
if (aPosInfoBase.PositionClassType() & EPositionSatelliteInfoClass) {
TCourse course;
TPositionSatelliteInfo *satInfo = static_cast<TPositionSatelliteInfo*>(&aPosInfoBase);
satInfo->GetCourse(course);
aQPosInfo.setAttribute(QGeoPositionInfo::Direction, course.Heading());
aQPosInfo.setAttribute(QGeoPositionInfo::GroundSpeed, course.Speed());
aQPosInfo.setAttribute(QGeoPositionInfo::VerticalSpeed, course.VerticalSpeed());
}
}
if (aPosInfoBase.PositionClassType() & EPositionGenericInfoClass) {
HPositionGenericInfo *genInfo = static_cast<HPositionGenericInfo*>(&aPosInfoBase);
float val;
//check for the horizontal speed
if (genInfo->IsFieldAvailable(EPositionFieldHorizontalSpeed)) {
genInfo->GetValue(EPositionFieldHorizontalSpeed, val);
aQPosInfo.setAttribute(QGeoPositionInfo::GroundSpeed, val);
}
//check for the vertcal speed
if (genInfo->IsFieldAvailable(EPositionFieldVerticalSpeed)) {
genInfo->GetValue(EPositionFieldVerticalSpeed, val);
aQPosInfo.setAttribute(QGeoPositionInfo::VerticalSpeed, val);
}
//check for the magnetic variation
if (genInfo->IsFieldAvailable(EPositionFieldMagneticCourseError)) {
genInfo->GetValue(EPositionFieldMagneticCourseError, val);
aQPosInfo.setAttribute(QGeoPositionInfo::MagneticVariation, val);
}
//check for the heading
if (genInfo->IsFieldAvailable(EPositionFieldHeading)) {
genInfo->GetValue(EPositionFieldHeading, val);
aQPosInfo.setAttribute(QGeoPositionInfo::Direction, val);
}
}
}
示例14: AddTime
void RTestExecuteLogServ::AddTime(TDes8& aLogBuffer)
{
TTime now;
now.UniversalTime();
TDateTime dateTime = now.DateTime();
_LIT8(KFormat,"%02d:%02d:%02d:%03d ");
// add the current time
aLogBuffer.AppendFormat(KFormat,dateTime.Hour(),dateTime.Minute(),dateTime.Second(),(dateTime.MicroSecond()/1000));
}
示例15: TestReportLog
LOCAL_C void TestReportLog(const TDesC8& aText)
{
TBuf8<200> buf;
TTime now;
now.UniversalTime();
TDateTime dateTime;
dateTime = now.DateTime();
buf.Format(_L8 ("%02d.%02d:%02d:%06d "),dateTime.Hour(),dateTime.Minute(),dateTime.Second(),dateTime.MicroSecond());
buf.AppendFormat(_L8("%S\015\012"),&aText);
TestRpt.Write(buf);
TestRpt.Flush();
}