Import: DXF backend, frontent; add time measurement

This commit is contained in:
Furgo
2025-06-13 04:07:39 +02:00
parent 77e4047871
commit f84ed59a43
4 changed files with 38 additions and 8 deletions

View File

@@ -48,6 +48,7 @@
#endif
#endif
#include <chrono>
#include "dxf/ImpExpDxf.h"
#include "SketchExportHelper.h"
#include <App/Application.h>
@@ -413,7 +414,13 @@ private:
ImpExpDxfRead dxf_file(EncodedName, pcDoc);
dxf_file.setOptionSource(defaultOptions);
dxf_file.setOptions();
auto startTime = std::chrono::high_resolution_clock::now();
dxf_file.DoRead(IgnoreErrors);
auto endTime = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = endTime - startTime;
dxf_file.setImportTime(elapsed.count());
pcDoc->recompute();
return dxf_file.getStatsAsPyObject();
}
@@ -423,7 +430,6 @@ private:
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
}