mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Merge branch 'vb_optgroup_refact'
This commit is contained in:
commit
ee58ab4e2d
20 changed files with 913 additions and 503 deletions
|
@ -18,6 +18,8 @@
|
|||
#include <wx/debug.h>
|
||||
#include <wx/settings.h>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "Event.hpp"
|
||||
|
||||
class wxCheckBox;
|
||||
|
@ -392,6 +394,32 @@ inline int hex_digit_to_int(const char c)
|
|||
}
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
class TaskTimer
|
||||
{
|
||||
std::chrono::milliseconds start_timer;
|
||||
std::string task_name;
|
||||
public:
|
||||
TaskTimer(std::string task_name):
|
||||
task_name(task_name.empty() ? "task" : task_name)
|
||||
{
|
||||
start_timer = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch());
|
||||
}
|
||||
|
||||
~TaskTimer()
|
||||
{
|
||||
std::chrono::milliseconds stop_timer = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch());
|
||||
auto process_duration = std::chrono::milliseconds(stop_timer - start_timer).count();
|
||||
std::string out = (boost::format("\n!!! %1% duration = %2% ms \n\n") % task_name % process_duration).str();
|
||||
printf(out.c_str());
|
||||
#ifdef __WXMSW__
|
||||
std::wstring stemp = std::wstring(out.begin(), out.end());
|
||||
OutputDebugString(stemp.c_str());
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue