test18 Program

Uses

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

Calls

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

   use kinds
   use fortime

   implicit none

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


   ! CPU time with nloops
   call t%ctimer_start()
   do nl = 1, nloops
      call sleep(1) ! Perform operations ntimes
   end do
   call t%ctimer_stop(message = 'CPU time:', print=.false.)
   call t%ctimer_write('test/test18_ctimes.txt') ! Optionally, write the elapsed time to a file

end program test18