| 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_; |
no test coverage detected