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

Method to_usec

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

Source from the content-addressed store, hash-verified

358 // Helper function to convert a duration into microseconds.
359 template <typename Duration>
360 long to_usec(const Duration& d, long max_duration) const
361 {
362 if (d.ticks() <= 0)
363 return 0;
364 int64_t usec = d.total_microseconds();
365 if (usec == 0)
366 return 1;
367 if (usec > max_duration)
368 return max_duration;
369 return static_cast<long>(usec);
370 }
371
372 // The head of a linked list of all active timers.
373 per_timer_data* timers_;

Callers 1

wait_duration_usecMethod · 0.95

Calls 2

ticksMethod · 0.80
total_microsecondsMethod · 0.80

Tested by

no test coverage detected