当前位置: 首页>>代码示例>>C++>>正文


C++ GetTimeStamp函数代码示例

本文整理汇总了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();
}
开发者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


注:本文中的GetTimeStamp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。