tick_seconds Function

public pure function tick_seconds(delta, rate) result(s)

Convert a system_clock delta to seconds.

Returns 0.0 when the rate is <= 0 (no real-time clock available or the clock wrapped to a non-positive rate). Avoids a division-by-zero FPE on platforms where system_clock does not provide a monotonic tick rate.

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: delta

Clock-count difference (may be negative on wrap-around).

integer(kind=int64), intent(in) :: rate

Ticks per second from system_clock count_rate.

Return Value real(kind=wp)