本文整理汇总了C++中StopClock类的典型用法代码示例。如果您正苦于以下问题:C++ StopClock类的具体用法?C++ StopClock怎么用?C++ StopClock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StopClock类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: guard
OptimizeAreasLowZoomRef Database::GetOptimizeAreasLowZoom() const
{
std::lock_guard<std::mutex> guard(optimizeAreasMutex);
if (!IsOpen()) {
return NULL;
}
if (!optimizeAreasLowZoom) {
optimizeAreasLowZoom=std::make_shared<OptimizeAreasLowZoom>();
StopClock timer;
if (!optimizeAreasLowZoom->Open(typeConfig,
path)) {
log.Error() << "Cannot load optimize areas low zoom index!";
optimizeAreasLowZoom=NULL;
return NULL;
}
timer.Stop();
log.Debug() << "Opening OptimizeAreasLowZoom: " << timer.ResultString();
}
return optimizeAreasLowZoom;
}
示例2: GetWaysByOffset
bool Database::GetWaysByOffset(const std::set<FileOffset>& offsets,
std::unordered_map<FileOffset,WayRef>& dataMap) const
{
WayDataFileRef wayDataFile=GetWayDataFile();
if (!wayDataFile) {
return false;
}
StopClock time;
bool result=wayDataFile->GetByOffset(offsets,dataMap);
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving ways by offset took " << time.ResultString();
}
return result;
}
示例3: GetWayByOffset
bool Database::GetWayByOffset(const FileOffset& offset,
WayRef& way) const
{
WayDataFileRef wayDataFile=GetWayDataFile();
if (!wayDataFile) {
return false;
}
StopClock time;
bool result=wayDataFile->GetByOffset(offset,way);
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving ways by offset took " << time.ResultString();
}
return result;
}
示例4: GetAreasByOffset
bool Database::GetAreasByOffset(const std::list<FileOffset>& offsets,
std::vector<AreaRef>& areas) const
{
AreaDataFileRef areaDataFile=GetAreaDataFile();
if (!areaDataFile) {
return false;
}
StopClock time;
bool result=areaDataFile->GetByOffset(offsets,areas);
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving areas by offset took " << time.ResultString();
}
return result;
}
示例5: GetAreaByOffset
bool Database::GetAreaByOffset(const FileOffset& offset,
AreaRef& area) const
{
AreaDataFileRef areaDataFile=GetAreaDataFile();
if (!areaDataFile) {
return false;
}
StopClock time;
bool result=areaDataFile->GetByOffset(offset,area);
time.Stop();
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving areas by offset took " << time.ResultString();
}
return result;
}
示例6: GetNodesByOffset
bool Database::GetNodesByOffset(const std::list<FileOffset>& offsets,
std::vector<NodeRef>& nodes) const
{
NodeDataFileRef nodeDataFile=GetNodeDataFile();
if (!nodeDataFile) {
return false;
}
StopClock time;
bool result=nodeDataFile->GetByOffset(offsets,nodes);
time.Stop();
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving nodes by offset took " << time.ResultString();
}
return result;
}
示例7: GetNodeByOffset
bool Database::GetNodeByOffset(const FileOffset& offset,
NodeRef& node) const
{
NodeDataFileRef nodeDataFile=GetNodeDataFile();
if (!nodeDataFile) {
return false;
}
StopClock time;
bool result=nodeDataFile->GetByOffset(offset,node);
time.Stop();
if (time.GetMilliseconds()>100) {
log.Warn() << "Retrieving nodes by offset took " << time.ResultString();
}
return result;
}
示例8: ExecuteModules
static bool ExecuteModules(std::list<ImportModule*>& modules,
const ImportParameter& parameter,
Progress& progress,
const TypeConfigRef& typeConfig)
{
StopClock overAllTimer;
size_t currentStep=1;
for (const auto& module : modules) {
if (currentStep>=parameter.GetStartStep() &&
currentStep<=parameter.GetEndStep()) {
StopClock timer;
bool success;
progress.SetStep(std::string("Step #")+
NumberToString(currentStep)+
" - "+
module->GetDescription());
success=module->Import(typeConfig,
parameter,
progress);
timer.Stop();
progress.Info(std::string("=> ")+timer.ResultString()+" second(s)");
if (!success) {
progress.Error(std::string("Error while executing step '")+module->GetDescription()+"'!");
return false;
}
}
currentStep++;
}
overAllTimer.Stop();
progress.Info(std::string("=> ")+overAllTimer.ResultString()+" second(s)");
return true;
}