本文整理汇总了C++中GetTimeStamp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTimeStamp函数的具体用法?C++ GetTimeStamp怎么用?C++ GetTimeStamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTimeStamp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FrameTimeLog
FrameScheduler::FrameScheduler(std::ostream *_LogDestination, Whole StartingThreadCount) :
FrameTimeLog(MEZZ_FRAMESTOTRACK),
PauseTimeLog(MEZZ_FRAMESTOTRACK),
CurrentFrameStart(GetTimeStamp()),
CurrentPauseStart(GetTimeStamp()),
LogDestination(_LogDestination),
Sorter(0),
#ifdef MEZZ_USEBARRIERSEACHFRAME
StartFrameSync(StartingThreadCount),
EndFrameSync(StartingThreadCount),
LastFrame(0),
#endif
#ifdef MEZZ_USEATOMICSTODECACHECOMPLETEWORK
DecacheMain(0),
DecacheAffinity(0),
#endif
CurrentThreadCount(StartingThreadCount),
FrameCount(0), TargetFrameLength(16666),
TimingCostAllowance(0),
MainThreadID(this_thread::get_id()),
LoggingToAnOwnedFileStream(false),
NeedToLogDeps(true)
{
Resources.push_back(new DefaultThreadSpecificStorage::Type(this));
(*LogDestination) << "<MezzanineLog>" << std::endl;
LogDestination->flush();
}
示例2: optic_flow
void optic_flow( cv::Mat mGray1, cv::Mat mGray2, cv::Mat& flow, cv::Mat& mAnnotated )
{
cv::Mat frame1_gray, frame2_gray;
cv::UMat flowUmat;
struct timeval start1,end1;
start1 = GetTimeStamp();
calcOpticalFlowFarneback(mGray1, mGray2,
flowUmat, 0.5, 3, 15, 3, 5, 1.2, 0);
flowUmat.copyTo(flow);
for (int y = 0; y < mAnnotated.rows; y += 5)
for (int x = 0; x < mAnnotated.cols; x += 5)
{
// get the flow from y, x position * 10 for better visibility
const cv::Point2f flowatxy = flow.at<cv::Point2f>(y, x) * 10;
// draw line at flow direction
line(mAnnotated, cv::Point(x, y), cv::Point( cvRound(x + flowatxy.x),
cvRound(y + flowatxy.y)), cv::Scalar(255,0,0));
// draw initial point
circle(mAnnotated, cv::Point(x, y), 1, cv::Scalar(0, 0, 0), -1);
}
end1 = GetTimeStamp();
float delta = ((end1.tv_sec-start1.tv_sec)*1000 - (end1.tv_usec - start1.tv_usec));
printf("OpticalFlowFarneback() Duration = %8.3f\n", delta/1000 );
}
示例3: QdplusBarometerThread
THREAD_FUNC QdplusBarometerThread(void *argptr)
{
INT32 i, value, missed;
struct {
ISIDL_TIMESTAMP prev;
ISIDL_TIMESTAMP crnt;
} ttag;
BAROMETER *bp;
static char *fid = "QdplusBarometerThread";
LogMsg(LOG_DEBUG, "%s started", fid);
bp = (BAROMETER *) argptr;
bp->nsamp = 0;
/* Time tag the current sample and stuff it into the buffer */
GetTimeStamp(&ttag.prev);
while (1) {
GetTimeStamp(&ttag.crnt);
if (ttag.crnt.sys > ttag.prev.sys) {
value = GetSample(bp);
missed = ttag.crnt.sys - ttag.prev.sys - 1;
for (i = 0; i < missed; i++) {
++ttag.prev.sys;
StuffSample(bp, &ttag.prev, MISSED_BAROMETER_SAMPLE);
}
StuffSample(bp, &ttag.crnt, value);
ttag.prev = ttag.crnt;
}
utilDelayMsec(250);
}
}
示例4: test_chip
bool test_chip(char chipid[])
{
nEntry++;
g_chipdata.Invalidate();
g_chipdata.nEntry = nEntry;
printf("#%05i: %s -> ", nEntry, chipid);
fflush(stdout);
Log.section("CHIP1", false);
Log.printf(" %s\n", chipid);
strcpy(g_chipdata.chipId, chipid);
GetTimeStamp(g_chipdata.startTime);
Log.timestamp("BEGIN");
tb.SetLed(0x10);
bool repeat;
int bin = settings.rocType == 0 ? TestRocAna::test_roc(repeat) : TestRocDig::test_roc(repeat);
tb.SetLed(0x00);
tb.Flush();
GetTimeStamp(g_chipdata.endTime);
Log.timestamp("END");
Log.puts("\n");
Log.flush();
printf("%3i\n", bin);
return true;
}
示例5: test_wafer
bool test_wafer()
{
int x, y;
g_chipdata.Invalidate();
if (!ReportWafer()) return true;
if (!ReportChip(x,y)) return true;
g_chipdata.nEntry = nEntry;
GetTimeStamp(g_chipdata.startTime);
Log.timestamp("BEGIN");
tb.SetLed(0x10);
bool repeat;
int bin = settings.rocType == 0 ? TestRocAna::test_roc(repeat) : TestRocDig::test_roc(repeat);
tb.SetLed(0x00);
tb.Flush();
GetTimeStamp(g_chipdata.endTime);
Log.timestamp("END");
Log.puts("\n");
Log.flush();
printf("%3i\n", bin);
printf(" RSP %s\n", prober.printf("BinMapDie %i", bin));
return true;
}
示例6: test_wafer
bool test_wafer()
{
int x, y;
g_chipdata.Invalidate();
if (!ReportWafer()) return true;
if (!ReportChip(x,y)) return true;
g_chipdata.nEntry = nEntry;
GetTimeStamp(g_chipdata.startTime);
Log.timestamp("BEGIN");
tb.SetLed(0x10);
bool repeat;
int bin = test_roc(repeat);
tb.SetLed(0x00);
tb.Flush();
GetTimeStamp(g_chipdata.endTime);
Log.timestamp("END");
Log.puts("\n");
Log.flush();
printf("%3i\n", bin);
prober.SendCmd("BinMapDie %i", bin);
return true;
}
示例7: WriteToConsole
void cLogMgr::Write(eLogLevel verbosity, std::string entry)
{
if (ENABLE_LOGGING)
{
WriteToConsole(verbosity, GetTimeStamp() + GetVerbosityToken(verbosity) + entry);
WriteToFile(verbosity, GetTimeStamp() + GetVerbosityToken(verbosity) + entry);
}
}
示例8: GetLowerLevel
void IPlatformFile::GetTimeStampPair(const TCHAR* PathA, const TCHAR* PathB, FDateTime& OutTimeStampA, FDateTime& OutTimeStampB)
{
if (GetLowerLevel())
{
GetLowerLevel()->GetTimeStampPair(PathA, PathB, OutTimeStampA, OutTimeStampB);
}
else
{
OutTimeStampA = GetTimeStamp(PathA);
OutTimeStampB = GetTimeStamp(PathB);
}
}
示例9: Wait
/*
* Wait
* ----
* wait n ticks.
*
* Paramters:
* n: ticks number.
*/
void Wait(int n) {
int start, end;
start = GetTimeStamp();
/* Loop if time laspe is lower than wait time */
while (1) {
end = GetTimeStamp();
if ((end - start) > n) {
break;
}
}
}
示例10: DrawSheetStruct
DrawSheetStruct * DrawSheetStruct::GenCopy(void)
/***********************************************/
{
DrawSheetStruct * newitem = new DrawSheetStruct(m_Pos);
DrawSheetLabelStruct * Slabel = NULL, * label = m_Label;
int ii;
newitem->m_End = m_End;
newitem->m_Parent = m_Parent;
newitem->m_TimeStamp = GetTimeStamp();
/* initialisation des Fields */
for(ii = 0; ii < NUMBER_OF_FIELDS; ii++)
{
m_Field[ii].PartTextCopy(& newitem->m_Field[ii]);
}
if( label )
{
Slabel = newitem->m_Label = label->GenCopy();
Slabel->m_Parent = newitem;
label = (DrawSheetLabelStruct*)label->Pnext;
}
while( label )
{
Slabel->Pnext = label->GenCopy();
Slabel = (DrawSheetLabelStruct*)Slabel->Pnext;
Slabel->m_Parent = newitem;
label = (DrawSheetLabelStruct*)label->Pnext;
}
return newitem;
}
示例11: Update
virtual void Update ()
{
// delete inverse;
if (GetTimeStamp() == bfa->GetTimeStamp()) return;
timestamp = bfa->GetTimeStamp();
cout << IM(3) << "Update Direct Solver Preconditioner" << flush;
try
{
auto have_sparse_fact = dynamic_pointer_cast<SparseFactorization> (inverse);
if (have_sparse_fact && have_sparse_fact -> SupportsUpdate())
{
if (have_sparse_fact->GetAMatrix() == bfa->GetMatrixPtr())
{
// cout << "have the same matrix, can update factorization" << endl;
have_sparse_fact->Update();
return;
}
}
bfa->GetMatrix().SetInverseType (inversetype);
shared_ptr<BitArray> freedofs =
bfa->GetFESpace()->GetFreeDofs (bfa->UsesEliminateInternal());
inverse = bfa->GetMatrix().InverseMatrix(freedofs);
}
catch (exception & e)
{
throw Exception (string("caught exception in DirectPreconditioner: \n") +
e.what() +
"\nneeds a sparse matrix (or has memory problems)");
}
}
示例12: va_start
void CLogSystem::WriteToLog( const char *format, ... )
{
if ( !m_bCreateLog ) return;
va_list argptr;
const int maxbytes=4095;
char buffer[maxbytes+1];
char cTimeStamp[30];
timeStamp_t timeStamp;
va_start(argptr, format);
_vsnprintf(buffer, maxbytes, format, argptr);
buffer[maxbytes]=NULL;
va_end(argptr);
GetTimeStamp( &timeStamp );
sprintf(cTimeStamp, "%4d-%02d-%02d %02d:%02d:%02d",
timeStamp.year, timeStamp.month, timeStamp.day, timeStamp.hour, timeStamp.minute, timeStamp.second);
fprintf(m_fpLog, "%s;%s\n", cTimeStamp, buffer);
}
示例13: m_directoryPath
Monitor::Monitor(SimObject * simObject, std::string directoryPath)
:m_simObject(simObject), m_directoryPath(directoryPath), m_timeStamp(GetTimeStamp())
{
//open csv
std::string fileName = m_directoryPath + "/" + simObject->GetName() + m_timeStamp + ".csv";
m_csvStream.open(fileName);
}
示例14: GetTimeStamp
long TimeStamp::GetDateStamp()
{
double time_stamp = GetTimeStamp();
int date_stamp = (int)time_stamp;
return date_stamp;
}
示例15: GetTimeStamp
void ClientTCP::measure_latency()
{
time_before_ = GetTimeStamp();
timer_.expires_from_now(boost::posix_time::seconds(MAX_DELAY));
timer_.async_wait(boost::bind(&ClientTCP::handle_timeout, this, boost::asio::placeholders::error));
socket_.async_connect(endpoint_, boost::bind(&ClientTCP::handle_connect, this, boost::asio::placeholders::error));
}