本文整理汇总了C++中TimeStamp函数的典型用法代码示例。如果您正苦于以下问题:C++ TimeStamp函数的具体用法?C++ TimeStamp怎么用?C++ TimeStamp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TimeStamp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TimeStamp
void MaxLogStream::DoLogString(const wxChar *szString, time_t t) {
wxString str;
TimeStamp(&str);
str << szString;
_wx_wxlog_wxLogStream__DoLogString(maxHandle, bbStringFromWxString(str));
}
示例2: mAsyncPanZoomController
GestureEventListener::GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController)
: mAsyncPanZoomController(aAsyncPanZoomController),
mState(GESTURE_NONE),
mSpanChange(0.0f),
mPreviousSpan(0.0f),
mLastTouchInput(MultiTouchInput::MULTITOUCH_START, 0, TimeStamp(), 0)
{
}
示例3: WXUNUSED
/// @brief Implementation of logging function.
void ListBoxLogger::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
wxString msg;
TimeStamp(&msg);
msg += szString;
m_lbox->Append(msg);
m_lbox->SetFirstItem(m_lbox->GetCount() - 1);
}
示例4: EndRun
int EndRun(StreamReader* Reader)
{
CurrRun.StopTime = TimeStamp( Reader->TrigSec, Reader->TrigNano );
CurrRun.FullTime = CurrRun.StopTime - CurrRun.StartTime - CurrRun.SkipTime;
//CurrRun.Dump();
CurrRun.DumpToFile( RunInfoOutput );
return 1;
}
示例5: TimeStamp
bool FvTimeStampTest::RunTest()
{
FvUInt64 uiTime = TimeStamp();
unsigned long uiTimeSec = StampsPerSecond();
std::cout << uiTime << std::endl;
std::cout << uiTimeSec << std::endl;
return true;
}
示例6: JELOG2
void CNetworkFieldIntensitySensor::SignalLevelReceivedL(TInt aLevel)
{
JELOG2(ESensor);
__ASSERT_DEBUG(iData != NULL, User::Invariant());
SensorData* data = iData[ KNISensorChannel ];
TTime currentTime;
if ((data->iTimeStampsIncluded) || (iBufferingPeriod > 0))
{
currentTime.UniversalTime();
if (iStartTime == KErrNotFound)
{
iStartTime = currentTime;
}
}
// P&S sensors are assumed to have one channel only
TInt interpretedValue = InterpretValue(aLevel);
// Negative values are error codes and therefore marked
// as invalid. Returned value for invalid values is zero.
if (interpretedValue < 0)
{
data->iIntValues[ data->iNumOfValues ] = KNISensorInvalidValue;
if (data->iValiditiesIncluded)
{
data->iValidities[ data->iNumOfValues ] = EFalse;
}
}
else
{
data->iIntValues[ data->iNumOfValues ] = interpretedValue;
if (data->iValiditiesIncluded)
{
data->iValidities[ data->iNumOfValues ] = ETrue;
}
}
if (data->iTimeStampsIncluded)
{
data->iTimeStamps[ data->iNumOfValues ] = TimeStamp(currentTime);
}
data->iNumOfValues++;
TInt64 intervalFromStart = -1;
if (iBufferingPeriod > 0)
{
intervalFromStart = currentTime.MicroSecondsFrom(iStartTime).Int64();
}
if ((data->iNumOfValues == iBufferSize) ||
(iBufferingPeriod > 0 && intervalFromStart > iBufferingPeriod))
{
SendData();
}
}
示例7: get
unsigned int get(RawHID::Device& device,IMU::RawSample rawSamples[2],PSMove::FeatureState& featureState,TimeStampSource& timeStampSource) // Reads next sensor data packet from given raw HID device directly into the given raw sample structures, updates given time stamp source; returns number of lost and received packets since last call
{
/* Read the next input report: */
memset(pktBuffer,0,sizeof(pktBuffer));
pktBuffer[0]=0x01U;
device.readReport(pktBuffer,sizeof(pktBuffer));
/* Extract set of button states and valuator state: */
featureState.buttons[0]=(pktBuffer[1]&0x01U)!=0;
featureState.buttons[1]=(pktBuffer[1]&0x08U)!=0;
featureState.buttons[2]=(pktBuffer[2]&0x10U)!=0;
featureState.buttons[3]=(pktBuffer[2]&0x20U)!=0;
featureState.buttons[4]=(pktBuffer[2]&0x40U)!=0;
featureState.buttons[5]=(pktBuffer[2]&0x80U)!=0;
featureState.buttons[6]=(pktBuffer[3]&0x01U)!=0;
featureState.buttons[7]=(pktBuffer[3]&0x08U)!=0;
featureState.buttons[8]=(pktBuffer[3]&0x10U)!=0;
featureState.valuators[0]=pktBuffer[6];
/* Unpack the report sequence number and time stamp: */
Misc::UInt16 newSequenceNumber=Misc::UInt16(pktBuffer[4]&0x0fU);
Misc::UInt16 sequenceNumberDelta=(newSequenceNumber-sequenceNumber)&0x0f;
sequenceNumber=newSequenceNumber;
timeStamp=(Misc::UInt16(pktBuffer[11])<<8)|Misc::UInt16(pktBuffer[43]);
/* Advance the time stamp source: */
timeStampSource.advance(TimeStamp(sequenceNumberDelta)*packetInterval);
struct // Helper bitfield structure to sign-extend a 12-bit integer
{
signed int si:12;
} s;
/* Unpack the battery and temperature state: */
batteryState=int(pktBuffer[12]);
temperature=s.si=((int(pktBuffer[37])<<4)|(int(pktBuffer[38])>>4))&0x0fff;
/* Fill in the raw sample structure for the first half-sample: */
for(int i=0;i<3;++i)
rawSamples[0].accelerometer[i]=((int(pktBuffer[14+i*2])<<8)|int(pktBuffer[13+i*2]))-0x8000;
for(int i=0;i<3;++i)
rawSamples[0].gyroscope[i]=((int(pktBuffer[26+i*2])<<8)|int(pktBuffer[25+i*2]))-0x8000;
rawSamples[0].magnetometer[0]=s.si=((int(pktBuffer[38])<<8)|int(pktBuffer[39]))&0x0fff;
rawSamples[0].magnetometer[1]=s.si=((int(pktBuffer[40])<<4)|(int(pktBuffer[41])>>4))&0x0fff;
rawSamples[0].magnetometer[2]=s.si=((int(pktBuffer[41])<<8)|int(pktBuffer[42]))&0x0fff;
/* Fill in the raw sample callback structure for the second half-sample: */
for(int i=0;i<3;++i)
rawSamples[1].accelerometer[i]=((int(pktBuffer[20+i*2])<<8)|int(pktBuffer[19+i*2]))-0x8000;
for(int i=0;i<3;++i)
rawSamples[1].gyroscope[i]=((int(pktBuffer[32+i*2])<<8)|int(pktBuffer[31+i*2]))-0x8000;
for(int i=0;i<3;++i)
rawSamples[1].magnetometer[i]=rawSamples[0].magnetometer[i];
return sequenceNumberDelta;
}
示例8: uint32_t
void
LayerManager::PostPresent()
{
if (!mTabSwitchStart.IsNull()) {
Telemetry::Accumulate(Telemetry::FX_TAB_SWITCH_TOTAL_MS,
uint32_t((TimeStamp::Now() - mTabSwitchStart).ToMilliseconds()));
mTabSwitchStart = TimeStamp();
}
}
示例9: Move
void
GMPAudioSamplesImpl::RelinquishData(GMPAudioEncodedSampleData& aData)
{
aData.mData() = Move(mBuffer);
aData.mTimeStamp() = TimeStamp();
if (mCrypto) {
mCrypto->RelinquishData(aData.mDecryptionData());
}
}
示例10: WriteSomethingToFile
void BioSeq::SearchFull(std::fstream &myfile)
{
int count = 0;
for(auto &m_a : m_motifs_a)
{
m_motif = m_a;
m_motif.score = 0;
m_motif.A_count = 0;
m_motif.G_count = 0;
m_motif.aQ.clear();
m_motif.bQ.clear();
m_motif.a_mis.clear();
m_motif.b_mis.clear();
if(IsMotif())
{
// std::cout<<"motif found, score: "<<m_motif.score<<std::endl;
// std::cout<<"motif found: "<<m_motif.bs.a+"."+m_motif.bs.b<<" "<<m_motif.bs.index<<std::endl;
// std::cout<<"motif found A nd G counts: "<<m_motif.A_count<< " "<<m_motif.G_count<<std::endl;
// std::cout<<"motif found aQ size: "<<m_motif.aQ.size()<<std::endl;
// std::cout<<"motif found aQ: \n";
// PrintVectorToConsole(m_motif.aQ, 0, m_motif.aQ.size()-1);
// std::cout<<"motif found bQ size: "<<m_motif.bQ.size()<<std::endl;
// std::cout<<"motif found bQ: \n";
// PrintVectorToConsole(m_motif.bQ, 0, m_motif.bQ.size()-1);
// std::cout<<"motif found a_mis size: "<<m_motif.a_mis.size()<<std::endl;
// std::cout<<"motif found a_mis: \n";
// PrintVectorToConsole(m_motif.a_mis, 0, m_motif.a_mis.size()-1);
// std::cout<<"motif found b_mis size: "<<m_motif.b_mis.size()<<std::endl;
// std::cout<<"motif found b_mis: \n";
// PrintVectorToConsole(m_motif.b_mis, 0, m_motif.b_mis.size()-1);
WriteSomethingToFile(myfile, "motif found: "+m_motif.bs.a+"."+m_motif.bs.b+
" score "+ std::to_string(m_motif.score)+"\n");
m_motifs.push_back(m_motif);
}
if(count%1000==0)
WriteSomethingToFile(myfile, TimeStamp()+"...processed "+
std::to_string(count)+" front motifs.\n");
count++;
}
std::sort(m_motifs.begin(), m_motifs.end(), [](const Motif &m1, const Motif &m2){return m1.score>m2.score;});
WriteSomethingToFile(myfile, TimeStamp()+"...finished searching, found "+
std::to_string(m_motifs.size())+" unique motifs.\n");
}
示例11: MOZ_ASSERT
RasterImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aManager);
MOZ_ASSERT((aFlags & ~(FLAG_SYNC_DECODE |
FLAG_SYNC_DECODE_IF_FAST |
FLAG_ASYNC_NOTIFY))
== FLAG_NONE,
"Unsupported flag passed to GetImageContainer");
int32_t maxTextureSize = aManager->GetMaxTextureSize();
if (!mHasSize ||
mSize.width > maxTextureSize ||
mSize.height > maxTextureSize) {
return nullptr;
}
if (IsUnlocked() && mProgressTracker) {
mProgressTracker->OnUnlockedDraw();
}
RefPtr<layers::ImageContainer> container = mImageContainer.get();
bool mustRedecode =
(aFlags & (FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST)) &&
mLastImageContainerDrawResult != DrawResult::SUCCESS &&
mLastImageContainerDrawResult != DrawResult::BAD_IMAGE;
if (container && !mustRedecode) {
return container.forget();
}
// We need a new ImageContainer, so create one.
container = LayerManager::CreateImageContainer();
DrawResult drawResult;
RefPtr<layers::Image> image;
Tie(drawResult, image) = GetCurrentImage(container, aFlags);
if (!image) {
return nullptr;
}
// |image| holds a reference to a SourceSurface which in turn holds a lock on
// the current frame's VolatileBuffer, ensuring that it doesn't get freed as
// long as the layer system keeps this ImageContainer alive.
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
imageList.AppendElement(ImageContainer::NonOwningImage(image, TimeStamp(),
mLastFrameID++,
mImageProducerID));
container->SetCurrentImagesInTransaction(imageList);
mLastImageContainerDrawResult = drawResult;
mImageContainer = container;
return container.forget();
}
示例12: OnErrorC
BOOL CALLBACK OnErrorC(int iServerNum, SOCKET* sock, const char* szData, CActionError& error)
{
CString sText;
sText+=TimeStamp()+"\r\n-------------- Error detected ------------\r\n";
sText+=Format("ERROR #%i %s (WSA:%s)\r\nData received:\r\n%s",error.getErrorCode(),error.getErrorDsc(),GetLastWSAError(),szData);
sText+="\r\n";
mainwndC->m_Sended=sText+mainwndC->m_Sended;
bNeedUpdateC=1;
return FALSE;
}
示例13: OnDataReceiveC
BOOL CALLBACK OnDataReceiveC(int iServerNum, const char* szData, int iDataLength)
{
CString sText;
sText+=TimeStamp()+"\r\n-------------- Received data ------------\r\n";
sText+=szData;
sText+="\r\n";
mainwndC->m_Sended=sText+mainwndC->m_Sended;
bNeedUpdateC=1;
return FALSE;
}
示例14: TimeStamp
void CheckerboardEvent::PropertyBuffer::Flush(
std::vector<PropertyValue>& aOut, const MonitorAutoLock& aProofOfLock) {
for (uint32_t i = 0; i < BUFFER_SIZE; i++) {
uint32_t ix = (mIndex + i) % BUFFER_SIZE;
if (!mValues[ix].mTimeStamp.IsNull()) {
aOut.push_back(mValues[ix]);
mValues[ix].mTimeStamp = TimeStamp();
}
}
}
示例15: oscSrcPositionHandler
int oscSrcPositionHandler( handlerArgs )
{
if( argv[ 0 ]->i >= twonderConf->noSources || argv[ 0 ]->i < 0 )
return -1;
// if source is not active, ignore the command
if( ! sources->at( argv[ 0 ]->i )->active )
return 0;
int sourceId = argv[ 0 ]->i;
float newX = argv[ 1 ]->f;
float newY = argv[ 2 ]->f;
float time = 0.0;
float duration = 0.0;
// xxx legacy support for deprecated z coordinate xxxxxxxxxxxxxxxxxxx //
// note that time and duration are also flipped in the newer versions //
//NOTE: this is where the z-coordinate could be introduced again for multi-z-level arrays
if( argc == 6 )
{
time = argv[ 4 ]->f;
duration = argv[ 5 ]->f;
}
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //
else if( argc == 5 )
{
duration = argv[ 3 ]->f;
time = argv[ 4 ]->f;
}
else if( argc == 4 )
{
duration = argv[ 3 ]->f;
}
if( twonderConf->verbose )
{
std::cout << "osc-position: src=" << sourceId
<< " x=" << newX
<< " y=" << newY
<< " ts=" << time
<< " dur=" << duration
<< std::endl;
}
Vector2D newPos( newX, newY );
MoveCommand* moveCmd = new MoveCommand( newPos,
sourceId,
TimeStamp( time ), // conversion to sampletime happens in TimeStamp( float );
( int ) ( duration * twonderConf->sampleRate ) );
realtimeCommandEngine->put( moveCmd );
return 0;
}