Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have a question about the loading speed of the active Hub structure using the API, specifically C ++. There are 10 projects in my HUB and the sum of all directories on the first level of these projects is 19. Retrieving information about these numbers is 16 s when using the FOR loop and 21 s when using the FOREACH loop.
I think both of these results are too long. Because when browsing these HUBs directly from the FUSIONI360 environment, the reactions are fast.
Is it okay or I'm making a mistake somewhere. Below is the code I use:
app = Application::get();
if (!app)
return false;
ui = app->userInterface();
if (!ui)
return false;
system_clock::time_point timeOfStart = system_clock::now();
int fol = 0, proj = 0;
for (size_t i = 0; i < app->data()->activeHub()->dataProjects()->count(); i++)
{
proj ++;
Ptr<DataProject> proj = app->data()->activeHub()->dataProjects()->item(i);
for (size_t ii = 0; ii < proj->rootFolder()->dataFolders()->count(); ii++)
{
fol++;
}
}
system_clock::time_point timeOfEnd = system_clock::now();
Solved! Go to Solution.