example2 Program

Uses

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

Calls

program~~example2~~CallsGraph program~example2 example2 proc~timer_start timer%timer_start program~example2->proc~timer_start proc~timer_stop timer%timer_stop program~example2->proc~timer_stop proc~timer_write timer%timer_write program~example2->proc~timer_write proc~print_time print_time proc~timer_stop->proc~print_time colorize colorize proc~print_time->colorize

Variables

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

Source Code

program example2

   use fortime

   implicit none

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

   call t%timer_start()
    do nl = 1, nloops
        call sleep(1) ! Perform operations ntimes
    end do
   call t%timer_stop(nloops = nloops, message = 'Elapsed time:', print = .true., color='green') ! nloops, message, print and color are optional. 
   call t%timer_write('example/example2_etimes.txt') ! Optionally, write the elapsed time to a file

end program example2