SaturnRingLibrary 0.9.2
SGL wrapper
Loading...
Searching...
No Matches

◆ ToSeconds()

Math::Types::Fxp SRL::Tickstamp::ToSeconds ( ) const
inlinenoexcept

Converts ticks to seconds using DVU hardware acceleration.

Returns
Time in seconds as fixed-point number (Fxp 16.16 format).

Uses SH-2 DVU for 64-bit division: (ticks << 16) / frequency. The result is in 16.16 fixed-point format with hardware precision.

Range:
  • Minimum: ~0.00000447 seconds (1 tick at PHI_128)
  • Maximum: 32767 seconds (~9.1 hours)
  • Overflow: Values above 32767 will wrap in Fxp 16.16 format
Accuracy:
Typical accuracy within ±0.1% for normal game timing (1ms to 1 hour).
Warning
CRITICAL: The return type Fxp 16.16 has a hard limit of 32767. If your ticks represent more than 32767 seconds, the result will overflow and produce incorrect values.
Example:
Tickstamp elapsed = Timer::DeltaTicks();
Fxp seconds = elapsed.ToSeconds();
Math::Types::Fxp ToSeconds() const noexcept
Converts ticks to seconds using DVU hardware acceleration.
Definition srl_timer.hpp:528
static const Tickstamp & DeltaTicks() noexcept
Frame delta ticks (raw elapsed ticks between frames).
Definition srl_timer.hpp:930
See also
ToMilliseconds() for millisecond precision (shorter range)