• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetCounter函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetCounter函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCounter函数的具体用法?C++ GetCounter怎么用?C++ GetCounter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetCounter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetCounter

void Instrument::InstrumentLoadStore(const Instruction* instr) {
    static Counter* load_int_counter = GetCounter("Load Integer");
    static Counter* store_int_counter = GetCounter("Store Integer");
    static Counter* load_fp_counter = GetCounter("Load FP");
    static Counter* store_fp_counter = GetCounter("Store FP");

    switch (instr->Mask(LoadStoreOpMask)) {
    case STRB_w:    // Fall through.
    case STRH_w:    // Fall through.
    case STR_w:     // Fall through.
    case STR_x:
        store_int_counter->Increment();
        break;
    case STR_s:     // Fall through.
    case STR_d:
        store_fp_counter->Increment();
        break;
    case LDRB_w:    // Fall through.
    case LDRH_w:    // Fall through.
    case LDR_w:     // Fall through.
    case LDR_x:     // Fall through.
    case LDRSB_x:   // Fall through.
    case LDRSH_x:   // Fall through.
    case LDRSW_x:   // Fall through.
    case LDRSB_w:   // Fall through.
    case LDRSH_w:
        load_int_counter->Increment();
        break;
    case LDR_s:     // Fall through.
    case LDR_d:
        load_fp_counter->Increment();
        break;
    }
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:34,代码来源:Instrument-vixl.cpp


示例2: switch

void
Control::Substitute(map<string,string>* __mapping){
switch(GetControlKind()){
   case ADaAn_FOR      :
            if(__mapping->find(GetCounter()) != __mapping->end())
               SetCounterName(__mapping->operator[](GetCounter()));
            GetForLowerBound()->Substitute(__mapping);
            GetForUpperBound()->Substitute(__mapping);
            return;
   case ADaAn_WHILE   :
            if(__mapping->find(GetCounter()) != __mapping->end())
               SetCounterName(__mapping->operator[](GetCounter()));
            GetCondition()->Substitute(__mapping);
            return;
   case ADaAn_IF      :
            GetCondition()->Substitute(__mapping);
            return;
   case ADaAn_IF_ELSE   :
            GetCondition()->Substitute(__mapping);
            return;
   }

cerr<<"Control::Rename, Fatal error(unhandled operator)";
throw(UNHANDLED_CASE);
exit(EXIT_FAILURE);
}
开发者ID:mbelaoucha,项目名称:fadalib,代码行数:26,代码来源:controlstructure.cpp


示例3: Run

	void Run()
	{
		LOG_INFO("Thread [%s] Start...", m_threadName);
		int ret = 0;
		for(int i= GetCounter(); i <= m_requestCount; i= GetCounter()){
			ClientCtx* ctx = GetCtx();

			ret = m_requestCb(i, ctx, m_args);
			
			if(ret== 0){
				AtomInt_Inc(&g_errors[0]);
			}else{
				if(ret < 0){
					AtomInt_Inc(&g_errors[ERRNO_UNKNOW]);
				}else{
					AtomInt_Inc(&g_errors[ret%0xFFFF]);
				}
			}

			if(i % m_num == 0){
				double usedtime = g_now_second -g_start;
				//LOG_DEBUG("start:%.3f - now:%.3f", g_start, g_now_second);
				printf("Request %d time:%.3f\n", i, usedtime);
			}
			if(g_stop) break;
		}
		
		LOG_INFO("Thread [%s] Stop...", m_threadName);
	}
开发者ID:fast01,项目名称:nginx-tcp-server,代码行数:29,代码来源:TcpTestClient.cpp


示例4: i386

/****************************************************************************
REMARKS:
If processor does not support time stamp reading, but is at least a 386 or
above, utilize method of timing a loop of BSF instructions which take a
known number of cycles to run on i386(tm), i486(tm), and Pentium(R)
processors.
****************************************************************************/
static ulong GetBSFCpuSpeed(
    ulong cycles)
{
    CPU_largeInteger t0,t1,count_freq;
    ulong   ticks;              /* Microseconds elapsed during test     */
    ulong   current;            /* Variable to store time elapsed       */
    int     i,j,iPriority;
    ulong   lowest  = (ulong)-1;

    iPriority = SetMaxThreadPriority();
    GetCounterFrequency(&count_freq);
    for (i = 0; i < SAMPLINGS; i++) {
	GetCounter(&t0);
	for (j = 0; j < INNER_LOOPS; j++)
	    _CPU_runBSFLoop(ITERATIONS);
	GetCounter(&t1);
	current = t1.low - t0.low;
	if (current < lowest)
	    lowest = current;
	}
    RestoreThreadPriority(iPriority);

    /* Compute frequency */
    ticks = _CPU_mulDiv(lowest,1000000,count_freq.low);
    if ((ticks % count_freq.low) > (count_freq.low/2))
	ticks++;            /* Round up if necessary */
    if (ticks == 0)
	return 0;
    return ((cycles*INNER_LOOPS)/ticks);
}
开发者ID:A1DEVS,项目名称:lenovo_a1_07_uboot,代码行数:37,代码来源:cpuinfo.c


示例5: operator

 uint32_t operator()()
 {
     uint32_t const counter = GetCounter();
     if ((counter % 3) == 0)
         return m_startIndex;
     return m_startIndex + counter - 2 * (counter / 3);
 }
开发者ID:65apps,项目名称:omim,代码行数:7,代码来源:batcher_helpers.cpp


示例6: InitGL

/* Initialize OpenGL Graphics */
void InitGL()
{
	StartCounter();
	gLastTime = GetCounter();
	// Set "clearing" or background color
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Black and opaque
}
开发者ID:darren-moore,项目名称:pinball-physics,代码行数:8,代码来源:main.cpp


示例7: GetCounter

unsigned int HighPerfTick::Tick()
{
	__int64 counter = GetCounter();
	unsigned int elapsed = (unsigned int)(counter - lastTick);
	lastTick = counter;
	return elapsed;
}
开发者ID:Valrandir,项目名称:KirbyCore,代码行数:7,代码来源:HighPerfTick.cpp


示例8: Idle

//---------------------------------------------------------------------------------
// Update from glut. Called when no more event handling.
//---------------------------------------------------------------------------------
void Idle()
{	
	static double prevTime = GetCounter();
	double tick = GetCounter() - prevTime;
	double currentTime = GetCounter();
	double deltaTime = currentTime - gLastTime;
	// Update.
	if (deltaTime > (UPDATE_MAX))
	{	
		gUpdateDeltaTime.Stop();
		glutPostRedisplay(); //everytime you are done 
		CSimpleControllers::GetInstance().Update();

		gUserUpdateProfiler.Start();
		if (gEditorMode)
		{
			EditorUpdate((float)deltaTime);			// Call user defined update.
		}
		else
		{
			Update((float)deltaTime);				// Call user defined update.
		}
		gUserUpdateProfiler.Stop();
		
		gLastTime = currentTime;		
		RECT tileClientArea;
		if (GetClientRect( MAIN_WINDOW_HANDLE, &tileClientArea))
		{
			WINDOW_WIDTH = tileClientArea.right - tileClientArea.left;
			WINDOW_HEIGHT = tileClientArea.bottom - tileClientArea.top;
		}

		if (App::GetController().CheckButton(APP_ENABLE_DEBUG_INFO_BUTTON) )
		{
			gRenderUpdateTimes = !gRenderUpdateTimes;
		}

		if (App::IsKeyPressed(APP_QUIT_KEY))
		{		
			glutLeaveMainLoop();
		}
		gUpdateDeltaTime.Start();
	}
	
}
开发者ID:darren-moore,项目名称:pinball-physics,代码行数:48,代码来源:main.cpp


示例9: GetTypeName

std::string ObjectGuid::GetString() const
{
    std::ostringstream str;
    str << GetTypeName() << " (";
    if (HasEntry())
        str << "Entry: " << GetEntry() << " ";
    str << "Guid: " << GetCounter() << ")";
    return str.str();
}
开发者ID:japtenks,项目名称:blizzlikecore,代码行数:9,代码来源:ObjectGuid.cpp


示例10: GetFreeBfRaid

// ****************************************************
// ******************* Group System *******************
// ****************************************************
Group* Battlefield::GetFreeBfRaid(TeamId TeamId)
{
    for (auto itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
        if (Group* group = sGroupMgr->GetGroupByGUID(itr->GetCounter()))
            if (!group->IsFull())
                return group;

    return nullptr;
}
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:12,代码来源:Battlefield.cpp


示例11: GetGroupPlayer

Group* Battlefield::GetGroupPlayer(ObjectGuid guid, TeamId TeamId)
{
    for (auto itr = m_Groups[TeamId].begin(); itr != m_Groups[TeamId].end(); ++itr)
        if (Group* group = sGroupMgr->GetGroupByGUID(itr->GetCounter()))
            if (group->IsMember(guid))
                return group;

    return nullptr;
}
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:9,代码来源:Battlefield.cpp


示例12: operator

  uint32_t operator()()
  {
    uint32_t const counter = GetCounter();
    uint32_t const result = m_startIndex + m_counter;
    if (counter % 2 == 0)
      m_counter++;

    return result;
  }
开发者ID:syershov,项目名称:omim,代码行数:9,代码来源:batcher_helpers.cpp


示例13: Update

void Instrument::VisitMoveWideImmediate(const Instruction* instr) {
    Update();
    static Counter* counter = GetCounter("Move Immediate");

    if (instr->IsMovn() && (instr->Rd() == kZeroRegCode)) {
        unsigned imm = instr->ImmMoveWide();
        HandleInstrumentationEvent(imm);
    } else {
        counter->Increment();
    }
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:11,代码来源:Instrument-vixl.cpp


示例14: GetTypeName

std::string ObjectGuid::ToString() const
{
    std::ostringstream str;
    str << "GUID Full: 0x" << std::hex << std::setw(16) << std::setfill('0') << _guid << std::dec;
    str << " Type: " << GetTypeName();
    if (HasEntry())
        str << (IsPet() ? " Pet number: " : " Entry: ") << GetEntry() << " ";

    str << " Low: " << GetCounter();
    return str.str();
}
开发者ID:Aravu,项目名称:Talador-Project,代码行数:11,代码来源:ObjectGuid.cpp


示例15: Pwm_Step

void Pwm_Step(void)
{
	unsigned long cur = GetCounter();
	unsigned long delta_timer = cur - gs_pwm_timer;
	unsigned int vkl_time = gs_current_percent <= 0 ? 0 :(gs_current_percent >= 100 ? g_settings.pwm_mlsec : gs_current_percent * g_settings.pwm_mlsec / 100);
	if(delta_timer >= g_settings.pwm_mlsec)
	{
		delta_timer = 0;
		gs_pwm_timer = cur;
	}
	SetRelayState(delta_timer < vkl_time);
}
开发者ID:klkn,项目名称:w1209,代码行数:12,代码来源:main.c


示例16: Down_Task

void Down_Task(void)
{
	switch(GetGrapCount())//层次
	{
		case 1:
			AddCounter();
			if(GetCounter() > 4)
				SetCounter(1);
			GetMainGrap(GetCounter());
			break;
		case 2:
			Level2_Down();
			break;
		case 3:
			Level3_Down();
			break;
		case 4:
			Level4_Down();
			break;
		default:break;
	}

}
开发者ID:yjduoduo,项目名称:LPC1768_V1.3,代码行数:23,代码来源:tasklist_backup.c


示例17: Pid_Step

void Pid_Step(void)
{
	float pid_value;
	unsigned long cur = GetCounter();
	float delta_temperature = gs_current_temperature - g_settings.pid_level; 
	if((cur - gs_pid_timer) < g_settings.pid_mlsec)
		return;
	gs_pid_timer = cur;
	gs_intergrator_value += delta_temperature*g_settings.pid_I;
	if(gs_intergrator_value > g_settings.pid_I_limit)
		gs_intergrator_value = g_settings.pid_I_limit;
	pid_value = gs_current_percent + g_settings.pid_P*delta_temperature + gs_intergrator_value + g_settings.pid_D*delta_temperature;
	gs_current_percent = (pid_value > 100) ? 100 : pid_value;
}
开发者ID:klkn,项目名称:w1209,代码行数:14,代码来源:main.c


示例18: Up_Task

void Up_Task(void)
{
	switch(GetGrapCount())//层次
	{
		case 1:
			if(GetCounter() > 1)
				SubCounter();	
			else
				SetCounter(4);				
			GetMainGrap(GetCounter());
			break;
		case 2:
			Level2_Up();
			break;
		case 3:
			Level3_Up();
			break;
		case 4:
			Level4_Up();
			break;
		default:break;
	}
	
}
开发者ID:yjduoduo,项目名称:LPC1768_V1.3,代码行数:24,代码来源:tasklist_backup.c


示例19: get_sort_time

double get_sort_time(int *pa, int len, void (fsort)(int * , int   ))
{
# if 0 //  计时方法1
	const clock_t begin = clock();
	 fsort(pa, len);
	 const clock_t end = clock();
	 return  (double)(end-begin)/CLOCKS_PER_SEC  ;
#endif
#if 0 // 计时方法2
	 DWORD begin = GetTickCount();
	 fsort(pa, len);
	 DWORD end = GetTickCount();

	 return end - begin;
#endif

	 StartCounter();
     fsort(pa, len);
     return  GetCounter() ;
 
}
开发者ID:xiaoyu1107,项目名称:DATA_STRUCT,代码行数:21,代码来源:sort_different.c


示例20: Inequation

Condition*
Control::GetRegularDomain(void){
Condition* result;
if(IsIf() || IsIfElse() || IsWhileLoop())
   {
   if(IsWhileLoop()){
      Inequation* ineq=new Inequation(new Expression(GetCounter()),FADA_GREATER_EQ,new Expression(1));
      Condition* count_ge_0 = new Condition (ineq);
      result=new Condition(count_ge_0,FADA_AND,GetCondition());
      return result;
      }
   return GetCondition();
   }
if(IsForLoop()){
   Inequation* ineq1=new Inequation ( new Expression(GetLoopCounter( )),FADA_GREATER_EQ,GetForLowerBound( ));
   Inequation* ineq2=new Inequation ( new Expression(GetLoopCounter( )),FADA_LESS_EQ,GetForUpperBound( ));
   result = new Condition( new Condition(ineq1), FADA_AND , new Condition(ineq2));
   return result;
   }
cout<<"\nControl::GetRegularDomain(void) .... inappropriate case \n";
throw(10);
}
开发者ID:mbelaoucha,项目名称:fadalib,代码行数:22,代码来源:controlstructure.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCreateHealth函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCount函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap