watch_clock Module

Clock utilities for timing measurements.

Provides a small wrapper over system_clock that standardizes rate/max initialization and offers helpers for deltas and conversion to seconds.

These helpers are intended for lightweight runtime timing, not for strict profiling or performance benchmarking.


Uses

  • module~~watch_clock~~UsesGraph module~watch_clock watch_clock iso_fortran_env iso_fortran_env module~watch_clock->iso_fortran_env

Functions

public pure function clock_delta(t0, t1, max) result(dt)

Compute tick delta between two readings with wraparound handling.

Read more…

Arguments

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

Start tick, end tick, and maximum tick before wrap.

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

Start tick, end tick, and maximum tick before wrap.

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

Start tick, end tick, and maximum tick before wrap.

Return Value integer(kind=int64)

public pure function ticks_to_seconds(ticks, rate) result(secs)

Convert ticks to seconds using a specified tick rate.

Arguments

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

Tick delta and tick rate.

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

Tick delta and tick rate.

Return Value real


Subroutines

public pure subroutine clock_init(rate, max)

Initialize system_clock parameters.

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(out) :: rate

Clock tick rate and maximum tick count as reported by system_clock.

Read more…
integer(kind=int64), intent(out) :: max

Clock tick rate and maximum tick count as reported by system_clock.

Read more…

public subroutine clock_now(t)

Fetch the current clock tick count.

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(out) :: t

Current tick count from system_clock.