Next: SELECTED_INT_KIND, Previous: SCALE, Up: Intrinsic Procedures
SECNDS — Time subroutineSECNDS(X) gets the time in seconds from the real-time system clock.
X is a reference time, also in seconds. If this is zero, the time in
seconds from midnight is returned. This function is non-standard and its
use is discouraged.
T = SECNDS (X)
| Name | Type
|
| T | REAL(4)
|
| X | REAL(4)
|
program test_secnds
real(4) :: t1, t2
print *, secnds (0.0) ! seconds since midnight
t1 = secnds (0.0) ! reference time
do i = 1, 10000000 ! do something
end do
t2 = secnds (t1) ! elapsed time
print *, "Something took ", t2, " seconds."
end program test_secnds