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


C++ TIMER::get_tau_timers方法代码示例

本文整理汇总了C++中TIMER::get_tau_timers方法的典型用法代码示例。如果您正苦于以下问题:C++ TIMER::get_tau_timers方法的具体用法?C++ TIMER::get_tau_timers怎么用?C++ TIMER::get_tau_timers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TIMER的用法示例。


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

示例1: execute

	virtual void execute(TIMER& timer) {
		void ** tau_timers = timer.get_tau_timers();

		std::vector<std::string>::const_iterator it = line_to_str_.begin();
		for (int line_num = 0; it!= line_to_str_.end(); ++it, ++line_num){
			const std::string &line_str = *it;
			if (line_str != ""){

				int total_time_timer_offset = line_num + sialx_lines_ * static_cast<int>(ServerTimer::TOTALTIME);
				if (tau_timers[total_time_timer_offset] != NULL){
					// Set total time string
					std::stringstream tot_sstr;
					tot_sstr << sip::GlobalState::get_program_num() << ": " << line_num << ": "  << " Total " << line_str;
					const char *tau_string = tot_sstr.str().c_str();
					TAU_PROFILE_TIMER_SET_NAME(tau_timers[total_time_timer_offset], tau_string);
				}

				int block_wait_timer_offset = line_num + sialx_lines_ * static_cast<int>(ServerTimer::BLOCKWAITTIME);
				if (tau_timers[block_wait_timer_offset] != NULL){
					// Set block wait time string
					std::stringstream blkw_sstr;
					blkw_sstr << sip::GlobalState::get_program_num() << ":" << line_num <<":" << " Blkwait " << line_str ;
					const char *tau_string = blkw_sstr.str().c_str();
					TAU_PROFILE_TIMER_SET_NAME(tau_timers[block_wait_timer_offset], tau_string);
				}

				int read_timer_offset = line_num + sialx_lines_ * static_cast<int>(ServerTimer::READTIME);
				if (tau_timers[read_timer_offset] != NULL){
					// Set disk read time string
					std::stringstream readd_sstr;
					readd_sstr << sip::GlobalState::get_program_num() << ":" << line_num <<":" << " ReadDisk " << line_str ;
					const char *tau_string = readd_sstr.str().c_str();
					TAU_PROFILE_TIMER_SET_NAME(tau_timers[read_timer_offset], tau_string);
				}

				int write_timer_offset = line_num + sialx_lines_ * static_cast<int>(ServerTimer::WRITETIME);
				if (tau_timers[write_timer_offset] != NULL){
					// Set disk write time string
					std::stringstream writed_sstr;
					writed_sstr << sip::GlobalState::get_program_num() << ":" << line_num <<":" << " WriteDisk " << line_str ;
					const char *tau_string = writed_sstr.str().c_str();
					TAU_PROFILE_TIMER_SET_NAME(tau_timers[write_timer_offset], tau_string);
				}

			}
		}
	}
开发者ID:BB-Goldstein,项目名称:aces4,代码行数:47,代码来源:server_timer.cpp


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