MCPcopy Create free account
hub / github.com/boostorg/asio / to_msec

Method to_msec

include/boost/asio/detail/timer_queue.hpp:346–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 // Helper function to convert a duration into milliseconds.
345 template <typename Duration>
346 long to_msec(const Duration& d, long max_duration) const
347 {
348 if (d.ticks() <= 0)
349 return 0;
350 int64_t msec = d.total_milliseconds();
351 if (msec == 0)
352 return 1;
353 if (msec > max_duration)
354 return max_duration;
355 return static_cast<long>(msec);
356 }
357
358 // Helper function to convert a duration into microseconds.
359 template <typename Duration>

Callers 1

wait_duration_msecMethod · 0.95

Calls 2

ticksMethod · 0.80
total_millisecondsMethod · 0.80

Tested by

no test coverage detected