We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4aa07fa + e025246 commit 351d0adCopy full SHA for 351d0ad
src/scheduler.cpp
@@ -23,7 +23,9 @@ CScheduler::~CScheduler()
23
#if BOOST_VERSION < 105000
24
static boost::system_time toPosixTime(const boost::chrono::system_clock::time_point& t)
25
{
26
- return boost::posix_time::from_time_t(boost::chrono::system_clock::to_time_t(t));
+ // Creating the posix_time using from_time_t loses sub-second precision. So rather than exporting the time_point to time_t,
27
+ // start with a posix_time at the epoch (0) and add the milliseconds that have passed since then.
28
+ return boost::posix_time::from_time_t(0) + boost::posix_time::milliseconds(boost::chrono::duration_cast<boost::chrono::milliseconds>(t.time_since_epoch()).count());
29
}
30
#endif
31
0 commit comments