* NAME: timer->fraction() * DESCRIPTION: return fractional part of timer in arbitrary terms */
| 322 | * DESCRIPTION: return fractional part of timer in arbitrary terms |
| 323 | */ |
| 324 | unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom) |
| 325 | { |
| 326 | timer = mad_timer_abs(timer); |
| 327 | |
| 328 | switch (denom) { |
| 329 | case 0: |
| 330 | return timer.fraction ? |
| 331 | MAD_TIMER_RESOLUTION / timer.fraction : MAD_TIMER_RESOLUTION + 1; |
| 332 | |
| 333 | case MAD_TIMER_RESOLUTION: |
| 334 | return timer.fraction; |
| 335 | |
| 336 | default: |
| 337 | return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, denom); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | /* |
| 342 | * NAME: timer->string() |
nothing calls this directly
no test coverage detected