本文整理汇总了C++中TimerPtr::step方法的典型用法代码示例。如果您正苦于以下问题:C++ TimerPtr::step方法的具体用法?C++ TimerPtr::step怎么用?C++ TimerPtr::step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimerPtr
的用法示例。
在下文中一共展示了TimerPtr::step方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadGraphFrom
void GraphIO::loadGraphFrom(const YAML::Node& doc)
{
TimerPtr timer = getProfiler()->getTimer("load graph");
timer->restart();
SemanticVersion version;
if(doc["version"].IsDefined()) {
version = doc["version"].as<SemanticVersion>();
} else {
// with 0.9.7 versioning was introduced, so assume that the version was 0.9.6
version = SemanticVersion(0, 9, 6);
}
graph_.getLocalGraph()->beginTransaction();
{
auto interlude = timer->step("load nodes");
loadNodes(doc, version);
}
{
auto interlude = timer->step("load connections");
loadConnections(doc, version);
}
graph_.getLocalGraph()->finalizeTransaction();
{
auto interlude = timer->step("load view");
loadViewRequest(graph_, doc);
}
timer->finish();
}
示例2: loadNodes
void GraphIO::loadNodes(const YAML::Node& doc, SemanticVersion version)
{
TimerPtr timer = getProfiler()->getTimer("load graph");
YAML::Node nodes = doc["nodes"];
if (nodes.IsDefined()) {
for (std::size_t i = 0, total = nodes.size(); i < total; ++i) {
const YAML::Node& n = nodes[i];
auto interlude = timer->step(n["uuid"].as<std::string>());
loadNode(n, version);
}
}
}
示例3: saveGraphTo
void GraphIO::saveGraphTo(YAML::Node& yaml)
{
TimerPtr timer = getProfiler()->getTimer("save graph");
timer->restart();
yaml["version"] = csapex::info::CSAPEX_VERSION;
saveNodes(yaml);
saveConnections(yaml);
{
auto interlude = timer->step("save view");
saveViewRequest(graph_, yaml);
}
timer->finish();
}