本文整理汇总了C++中Profiler::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Profiler::print方法的具体用法?C++ Profiler::print怎么用?C++ Profiler::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finish
void Program::finish()
{
if (tracing_enabled)
program_profiler.print();
}
示例2: timerUpdate
//.........这里部分代码省略.........
continue;
} else {
m_blocks_update_last = 0;
}
++calls;
auto block = ir.second;
if (!block)
continue;
{
auto lock = block->try_lock_unique_rec();
if (!lock->owns_lock())
continue;
if(block->getUsageTimer() > unload_timeout) { // block->refGet() <= 0 &&
v3POS p = block->getPos();
//infostream<<" deleting block p="<<p<<" ustimer="<<block->getUsageTimer() <<" to="<< unload_timeout<<" inc="<<(uptime - block->m_uptime_timer_last)<<" state="<<block->getModified()<<std::endl;
// Save if modified
if (block->getModified() != MOD_STATE_CLEAN && save_before_unloading) {
//modprofiler.add(block->getModifiedReasonString(), 1);
if(!save_started++)
beginSave();
if (!saveBlock(block))
continue;
saved_blocks_count++;
}
blocks_delete.push_back(block);
if(unloaded_blocks)
unloaded_blocks->push_back(p);
deleted_blocks_count++;
} else {
#ifndef SERVER
if (block->mesh_old)
block->mesh_old = nullptr;
#endif
if (!block->m_uptime_timer_last) // not very good place, but minimum modifications
block->m_uptime_timer_last = uptime - 0.1;
block->incrementUsageTimer(uptime - block->m_uptime_timer_last);
block->m_uptime_timer_last = uptime;
block_count_all++;
/*#ifndef SERVER
if(block->refGet() == 0 && block->getUsageTimer() >
g_settings->getFloat("unload_unused_meshes_timeout"))
{
if(block->mesh){
delete block->mesh;
block->mesh = NULL;
}
}
#endif*/
}
} // block lock
if (porting::getTimeMs() > end_ms) {
m_blocks_update_last = n;
break;
}
}
}
if(save_started)
endSave();
if (!calls)
m_blocks_update_last = 0;
for (auto & block : blocks_delete)
this->deleteBlock(block);
// Finally delete the empty sectors
if(deleted_blocks_count != 0) {
if (m_blocks_update_last)
infostream << "ServerMap: timerUpdate(): Blocks processed:" << calls << "/" << m_blocks.size() << " to " << m_blocks_update_last << std::endl;
PrintInfo(infostream); // ServerMap/ClientMap:
infostream << "Unloaded " << deleted_blocks_count << "/" << (block_count_all + deleted_blocks_count)
<< " blocks from memory";
infostream << " (deleteq1=" << m_blocks_delete_1.size() << " deleteq2=" << m_blocks_delete_2.size() << ")";
if(saved_blocks_count)
infostream << ", of which " << saved_blocks_count << " were written";
/*
infostream<<", "<<block_count_all<<" blocks in memory";
*/
infostream << "." << std::endl;
if(saved_blocks_count != 0) {
PrintInfo(infostream); // ServerMap/ClientMap:
//infostream<<"Blocks modified by: "<<std::endl;
modprofiler.print(infostream);
}
}
return m_blocks_update_last;
}