Basic timer to measure the seconds between start and stop by counting clock cycles.
Timer type that holds CPU clock counts and rate.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=i8), | public | :: | t(2) | = | 0_i8 |
CPU clock counts t1, t2. |
|
integer(kind=i8), | public | :: | rate | = | 0_i8 |
CPU clock rate. |
Returns elapsed time between timer start and stop in seconds as 8-byte real. The result is 0.0 if the timer has not been stopped yet.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(timer_type), | intent(inout) | :: | timer |
Timer type. |
Stops the timer and optionally returns result as 8-byte real in
duration
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(timer_type), | intent(inout) | :: | timer |
Timer type. |
||
real(kind=r8), | intent(out), | optional | :: | duration |
Elapsed time between start and stop [sec]. |
Starts the timer by setting clock rate and first clock count.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(timer_type), | intent(inout) | :: | timer |
Timer type. |