example6 Program

Uses

  • program~~example6~~UsesGraph program~example6 example6 module~fortime fortime program~example6->module~fortime kinds kinds module~fortime->kinds

Calls

program~~example6~~CallsGraph program~example6 example6 proc~dtimer_start timer%dtimer_start program~example6->proc~dtimer_start proc~dtimer_stop timer%dtimer_stop program~example6->proc~dtimer_stop proc~dtimer_write timer%dtimer_write program~example6->proc~dtimer_write proc~print_time print_time proc~dtimer_stop->proc~print_time proc~to_seconds to_seconds proc~dtimer_stop->proc~to_seconds colorize colorize proc~print_time->colorize

Variables

Type Attributes Name Initial
integer :: nl
integer :: nloops = 3
type(timer) :: t

Source Code

program example6

   use fortime

   implicit none

   type(timer) :: t
   integer :: nl, nloops=3

   call t%dtimer_start()
    do nl = 1, nloops
        call sleep(1) ! Perform operations ntimes
    end do
   call t%dtimer_stop(nloops = nloops, message = 'Elapsed time:', print = .true., color='red') ! nloops, message, print and color are optional. 
   call t%dtimer_write('example/example6_etimes.txt') ! Optionally, write the elapsed time to a file

end program example6