SaturnRingLibrary 0.9.2
SGL wrapper
Loading...
Searching...
No Matches
SRL::Tickstamp::ClockTime Struct Reference

Detailed Description

Immutable clock display format (HH:MM:SS.mmm).

Returned by Tickstamp::ToClock(). Uses only 1 DVU division internally (minutes-based), then integer arithmetic for split. Intended for GUI display only — not for precise calculations or comparisons. Uses pure truncation throughout the chain (minutes → seconds → milliseconds) for consistent display.

Precision chain:
  • Minutes: 16-bit Fxp fraction → ~0.9ms precision per second
  • Seconds: derived from fractional minutes × 60 → 0–59
  • Milliseconds: derived from fractional seconds × 1000 → 0–999 (~0.015ms precision)
Range:
  • Maximum: ~546 hours (~22.7 days), limited by ToMinutes() Fxp range
  • Minimum: 0 hours, 0 minutes, 0 seconds, 0 milliseconds
Immutability:
Fields are read-only. Only Tickstamp::ToClock() can construct instances. This prevents misuse in time comparisons where Fxp methods should be used.

#include <srl_timer.hpp>

Public Member Functions

constexpr ClockTime () noexcept
 Default constructor. Initializes to 00:00:00.000.
uint16_t Hours () const noexcept
 Hours component (0–546).
uint16_t Milliseconds () const noexcept
 Milliseconds component (0–999).
uint8_t Minutes () const noexcept
 Minutes component (0–59).
uint8_t Seconds () const noexcept
 Seconds component (0–59).