From a0f0f329c858b2ef7ddce1abcf88e5fe31521c2c Mon Sep 17 00:00:00 2001 From: Sergey Kovalev Date: Wed, 24 Nov 2021 00:18:55 +0700 Subject: [PATCH] Fix chrono --- src/slic3r/Utils/TCPConsole.cpp | 8 ++++---- src/slic3r/Utils/TCPConsole.hpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/slic3r/Utils/TCPConsole.cpp b/src/slic3r/Utils/TCPConsole.cpp index edbfd8cde..bb834bb5f 100644 --- a/src/slic3r/Utils/TCPConsole.cpp +++ b/src/slic3r/Utils/TCPConsole.cpp @@ -158,18 +158,18 @@ namespace Slic3r { } } - void TCPConsole::set_deadline_in(boost::chrono::steady_clock::duration d) + void TCPConsole::set_deadline_in(std::chrono::steady_clock::duration d) { - deadline_ = boost::chrono::steady_clock::now() + d; + deadline_ = std::chrono::steady_clock::now() + d; } bool TCPConsole::is_deadline_over() { - return deadline_ < boost::chrono::steady_clock::now(); + return deadline_ < std::chrono::steady_clock::now(); } bool TCPConsole::run_queue() { - auto now = boost::chrono::steady_clock::now(); + auto now = std::chrono::steady_clock::now(); try { // TODO: Add more resets and initializations after previous run (reset() method?..) set_deadline_in(connect_timeout_); diff --git a/src/slic3r/Utils/TCPConsole.hpp b/src/slic3r/Utils/TCPConsole.hpp index 507325db6..20472750b 100644 --- a/src/slic3r/Utils/TCPConsole.hpp +++ b/src/slic3r/Utils/TCPConsole.hpp @@ -24,9 +24,9 @@ namespace Slic3r { { newline_ = "\n"; done_string_ = "ok"; - connect_timeout_ = boost::chrono::milliseconds(5000); - write_timeout_ = boost::chrono::milliseconds(10000); - read_timeout_ = boost::chrono::milliseconds(10000); + connect_timeout_ = std::chrono::milliseconds(5000); + write_timeout_ = std::chrono::milliseconds(10000); + read_timeout_ = std::chrono::milliseconds(10000); } void set_line_delimiter(const std::string& newline) { @@ -62,16 +62,16 @@ namespace Slic3r { void wait_next_line(); std::string extract_next_line(); - void set_deadline_in(boost::chrono::steady_clock::duration); + void set_deadline_in(std::chrono::steady_clock::duration); bool is_deadline_over(); std::string host_name_; std::string port_name_; std::string newline_; std::string done_string_; - boost::chrono::steady_clock::duration connect_timeout_; - boost::chrono::steady_clock::duration write_timeout_; - boost::chrono::steady_clock::duration read_timeout_; + std::chrono::steady_clock::duration connect_timeout_; + std::chrono::steady_clock::duration write_timeout_; + std::chrono::steady_clock::duration read_timeout_; std::list cmd_queue_; @@ -83,7 +83,7 @@ namespace Slic3r { bool is_connected_; boost::system::error_code error_code_; - boost::chrono::steady_clock::time_point deadline_; + std::chrono::steady_clock::time_point deadline_; }; } // Utils