use fortime
type(timer) :: t
call t%timer_start()
! Your code or section to be timed
call t%timer_stop(nloops, message, print=.true.) ! nloops, message and print are optional
@hkvzjal
I would recommend you look to other threads, as of the timing routines mentioned in this thread, system_clock is probably the best routine available.
You need to test the different integer kind arguments, as this can vary the accuracy and range.
Using 8-byte integers in Gfortran gives a comparitively accurate result. I have posted elsewhere comparing system_clock to date_and_time or omp_get_wtime, which both exhibit poor relative precision on the compilers I use. A number of Windows based timers are limited to 64 value updates per second, which often gives a poor result.
The quoted performance for PGI of being limited to 36 minutes [of elapsed time?] looks very suspicious, which is another red flag for this thread. I have not used the PGI compiler.
Timer performance varies greatly between operating systems.