Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fortran time program execution

JohnNichols
Honored Contributor I
271 Views

If I do a google search on the terms "Fortran time program execution"

the interesting return shows the standard program in the AI section, which is nice, except for the implicit none loss.

 

program timing_example
    real :: t1, t2

    ! Call CPU_TIME before the code section
    call cpu_time(t1)

    ! *** Section of code to be timed goes here ***
    ! Example: a loop that does significant work
    do i = 1, 100000000
        ! Some computation
    end do
    ! ********************************************

    ! Call CPU_TIME after the code section
    call cpu_time(t2)

    print *, 'Time taken for code section: ', t2 - t1, ' seconds'

end program timing_example

 

 

 

 

 

but interestingly it shows the following 

 

JohnNichols_0-1768781099498.png

 

0 Kudos
0 Replies
Reply