本文整理汇总了C++中GetTimeStamp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTimeStamp函数的具体用法?C++ GetTimeStamp怎么用?C++ GetTimeStamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTimeStamp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:BlackToppStudios,项目名称:DAGFrameScheduler,代码行数:27,代码来源:framescheduler.cpp
示例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 );
}
开发者ID:stenniswood,项目名称:bk_code,代码行数:28,代码来源:optical_flow.cpp
示例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);
}
}
开发者ID:jandog8990,项目名称:asl-station-processor,代码行数:34,代码来源:qdplus.c
示例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;
}
开发者ID:EJDomi,项目名称:psi46test_readout_chain,代码行数:30,代码来源:cmd_wafertest.cpp
示例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;
}
开发者ID:EJDomi,项目名称:psi46test_readout_chain,代码行数:27,代码来源:cmd_wafertest.cpp
示例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;
}
开发者ID:maiatec,项目名称:psi46test,代码行数:27,代码来源:cmd_wafertest.cpp
示例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);
}
}
开发者ID:k39chen,项目名称:Cadabolg,代码行数:8,代码来源:cLogMgr.cpp
示例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);
}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:12,代码来源:GenericPlatformFile.cpp
示例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;
}
}
}
开发者ID:yeqingyan,项目名称:tos_tos,代码行数:21,代码来源:timer.c
示例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;
}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:34,代码来源:cmpclass.cpp
示例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)");
}
}
开发者ID:ddrake,项目名称:ngsolve,代码行数:33,代码来源:preconditioner.cpp
示例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);
}
开发者ID:gthgame,项目名称:gth,代码行数:28,代码来源:log.cpp
示例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);
}
开发者ID:ghraelo,项目名称:BraitenbergSimulator,代码行数:7,代码来源:Monitor.cpp
示例14: GetTimeStamp
long TimeStamp::GetDateStamp()
{
double time_stamp = GetTimeStamp();
int date_stamp = (int)time_stamp;
return date_stamp;
}
开发者ID:dwaynecam,项目名称:TimeStamp,代码行数:7,代码来源:TimeStamp.cpp
示例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));
}
开发者ID:mystic123,项目名称:Computer-Networks,代码行数:7,代码来源:clienttcp.cpp
示例16: GetTimeStamp
VOID ScoreKeeper::ExpireStaleStates(
IN BOOLEAN FlushAll)
{
std::map<ULONG, ApplicationState *>::iterator It;
ULONG CurrentTimeStamp = GetTimeStamp();
for (It = ApplicationStateHash.begin();
It != ApplicationStateHash.end();
)
{
//
// If we're not removing all entries and this entry is not expired, don't
// remove it.
//
if (!FlushAll)
{
if ((CurrentTimeStamp - (*It).second->GetLastTouchTime()) < APPLICATION_EXPIRATION_TIME_WINDOW)
{
It++;
continue;
}
}
//
// If we get here, we're removing the entry.
//
ApplicationState *State = (*It).second;
ApplicationStateHash.erase(It);
delete State;
It = ApplicationStateHash.begin();
}
}
开发者ID:340211173,项目名称:hf-2011,代码行数:35,代码来源:ScoreKeeper.cpp
示例17: sprintf
j_boolean_t CAccessOprator::HasDownLoaded(const j_char_t *pFileName)
{
try
{
char strCmd[512] = {0};
sprintf(strCmd, "SELECT * FROM FileInfo WHERE FileName = '%s';", pFileName);
m_pRec = m_pConn->Execute((_bstr_t)strCmd, NULL, adCmdText);
if (!m_pRec->EndOfFile)
{
return true;
}
j_string_t strTimeStamp = GetTimeStamp(pFileName);
memset (strCmd, 0, sizeof(strCmd));
sprintf(strCmd, "SELECT * FROM FileInfo WHERE [TimeStamp] <= (SELECT MIN([TimeStamp]) FROM FileInfo);");
m_pRec = m_pConn->Execute((_bstr_t)strCmd, NULL, adCmdText);
if (!m_pRec->EndOfFile && strTimeStamp < (char*)_bstr_t(m_pRec->GetCollect("TimeStamp")))
{
return true;
}
}
catch (...){}
return false;
}
开发者ID:dalinhuang,项目名称:jorhy-xl,代码行数:25,代码来源:AccessOprator.cpp
示例18: GetID
//Debug
void
Packet::Print ()
{
std::cout <<
" ********** \n **Packet:"
"\n ** ID " << GetID () <<
" timeStamp " << GetTimeStamp () <<
"\n ** size: " << GetSize() <<
"\n ** sourcePort " << GetSourcePort() <<
" destinationPort " << GetDestinationPort() <<
"\n ** srcIP " << GetSourceID() <<
" dstIP " << GetDestinationID() <<
"\n ** srcMAC " << GetSourceMAC() <<
" dstMAC " << GetDestinationMAC() << std::endl;
if (m_RLCHeader->IsAFragment())
std::cout << " ** IsAFragment TRUE ";
else
std::cout << " ** IsAFragment FALSE ";
if (m_RLCHeader->IsTheLatestFragment())
std::cout << " IsTheLatestFragment TRUE ";
else
std::cout << " IsTheLatestFragment FALSE ";
std::cout << "\n **********" << std::endl;
}
开发者ID:Linyes,项目名称:lte_sim,代码行数:28,代码来源:Packet.cpp
示例19: GetTimeStamp
LRESULT CAgentCfg::WriteDevicesFile(std::string xmlFile, std::string destFolder)
{
std::string contents;
contents+="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
contents+="<MTConnectDevices xmlns=\"urn:mtconnect.org:MTConnectDevices:1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:mtconnect.org:MTConnectDevices:1.1 http://www.mtconnect.org/schemas/MTConnectDevices_1.1.xsd\">\n";
contents+=StdStringFormat("<Header bufferSize=\"130000\" instanceId=\"1\" creationTime=\"%s\" sender=\"local\" version=\"1.1\"/>\n",
GetTimeStamp().c_str());
contents+="<Devices>\n";
// Check all machine names unique
// Generate Devices.xml file with all devices in it.
for(UINT i=0; i<devices.size(); i++)
{
std::string config = ReadXmlDevicesFile(devices[i]);
ReplaceAll(config,"####", names[i]);
config=ReplaceOnce(config,"name=\"NNNNNN\"","name=\""+names[i]+"\"");
contents+=config+"\n";
}
contents+="</Devices>\n";
contents+="</MTConnectDevices>\n";
if(!xmlFile.empty())
WriteFile(destFolder + "\\" + xmlFile , contents);
return 0;
}
开发者ID:amanrenishaw,项目名称:MTConnectGadgets,代码行数:26,代码来源:AgentCfg.cpp
示例20: updatefromserver
void updatefromserver(char server_reply[255],struct device *s_device){
int linecount = 0,countdelimiter=0;
char **res,buff[255];
char reply[100];
int servertime;
//printf("enterrd func");
strcpy(reply,server_reply);
servertime = GetTimeStamp(reply);
//printf("Time : %d\n",servertime);
if (strstr(server_reply,"Switch")!=NULL)
{
split( server_reply, ':', &res, &countdelimiter );
if((strstr(res[2],"On"))!=NULL) { s_device->onstatus = true;
//printf("Turned on from server\n");
}
else if ((strstr(res[2],"Off"))!=NULL) {
s_device->onstatus = false;
//printf("Turned off from server\n");
}
else printf("Corrupted message from server\n");
}
else printf("Corrupted message from server Message Type Unknown\n");
//Logical Clock
if(servertime > ((long int) time(NULL)+timediff))
timediff = timediff + (servertime - ((long int) time(NULL)));
// printf("End of func\n");
}
开发者ID:arjunv91,项目名称:iot,代码行数:30,代码来源:device.c
注:本文中的GetTimeStamp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论