example4 Program

Uses

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

Calls

program~~example4~~CallsGraph program~example4 example4 proc~ctimer_start timer%ctimer_start program~example4->proc~ctimer_start proc~ctimer_stop timer%ctimer_stop program~example4->proc~ctimer_stop proc~ctimer_write timer%ctimer_write program~example4->proc~ctimer_write proc~print_time print_time proc~ctimer_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 example4

   use fortime

   implicit none

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

   call t%ctimer_start()
    do nl = 1, nloops
        call sleep(1) ! Perform operations ntimes
    end do
   call t%ctimer_stop(nloops = nloops, message = 'CPU time:', print = .true., color='yellow') ! nloops, message, print and color are optional. 
   call t%ctimer_write('example/example4_ctimes.txt') ! Optionally, write the elapsed time to a file

end program example4