Clicky
Showing changes from revision #2 to #3:
(追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)
(削除) Determines the (削除ここまで)(追記) SYSTEM_CLOCK(f95)
(追記ここまで)(削除) (追記) lets you measure durations of time with the precision of the smallest time increment generally available on a system by returning processor-dependent values based on the current value of the processor clock. The (追記ここまで)count
(削除ここまで)(削除) of milliseconds of wall clock time since the Epoch (00:00:00 UTC, January 1, 1970) modulo (削除ここまで)(追記) clock
(追記ここまで)(追記) value is incremented by one for each clock count until the value (追記ここまで)count_max
(削除) , (削除ここまで)(追記) (追記ここまで)(追記) is (追記ここまで)(追記) reached (追記ここまで)(追記) and (追記ここまで)(追記) is (追記ここまで)(追記) then (追記ここまで)(追記) reset (追記ここまで)(追記) to (追記ここまで)(追記) zero (追記ここまで)(追記) at (追記ここまで)(追記) the (追記ここまで)(追記) next (追記ここまで)(追記) count. (追記ここまで)(追記) clock
(追記ここまで)(追記) therefore is a modulo value that lies in the range 0 to (追記ここまで)(追記) count_max
(追記ここまで)(追記) . (追記ここまで)count_rate
(削除) determines (削除ここまで)(追記) and (追記ここまで)(削除) the (削除ここまで)(削除) number (削除ここまで)(削除) of (削除ここまで)(削除) clock (削除ここまで)(削除) ticks (削除ここまで)(削除) per (削除ここまで)(削除) second. (削除ここまで)(削除) count_rate
(削除ここまで)(削除) and (削除ここまで)count_max
are(追記) assumed (追記ここまで) constant(削除) and (削除ここまで)(追記) (even (追記ここまで)(削除) specific (削除ここまで)(追記) though (追記ここまで)(削除) to (削除ここまで)(追記) CPU (追記ここまで)(追記) rates (追記ここまで)(追記) can (追記ここまで)(追記) vary (追記ここまで)(追記) on (追記ここまで)(追記) a (追記ここまで)(追記) single (追記ここまで)(追記) platform). (追記ここまで)(削除) gfortran (削除ここまで)(追記) count_rate (追記ここまで)(削除) . (削除ここまで)(追記) (追記ここまで)(追記) reports (追記ここまで)(追記) the (追記ここまで)(追記) number (追記ここまで)(追記) of (追記ここまで)(追記) clock (追記ここまで)(追記) ticks (追記ここまで)(追記) per (追記ここまで)(追記) second, (追記ここまで)(追記) allowing (追記ここまで)(追記) clock
(追記ここまで)(追記) values to be translated from clock clicks to seconds. (追記ここまで)
If there is no clock, count
is set to -huge(count)
, and count_rate
and count_max
are set to(削除) zero (削除ここまで)(追記) zero. (追記ここまで)
SYSTEM_CLOCK(f95)
is typically used to measure short time intervals (system clocks may be 24-hour clocks or measure processor clock ticks since boot, for example). It is most often used for measuring or tracking the time spent in code blocks in lieu of using profiling tools.
Fortran 95 and later
Subroutine
call system_clock([count, count_rate, count_max])
count
- (Optional) shall be a scalar of typeinteger
with intent(out)
.count_rate
- (Optional) shall be a scalar of typeinteger
(追記) or (追記ここまで)(追記) real
(追記ここまで) with intent(out)
.count_max
- (Optional) shall be a scalar of typeinteger
with intent(out)
.program test_system_clock
integer :: count, count_rate, count_max
call system_clock(count, count_rate, count_max)
write(*,*) count, count_rate, count_max
end program