test15 Program

Uses

  • program~~test15~~UsesGraph program~test15 test15 forunittest forunittest program~test15->forunittest kinds kinds program~test15->kinds module~fortime fortime program~test15->module~fortime module~fortime->kinds

Calls

program~~test15~~CallsGraph program~test15 test15 check check program~test15->check proc~timer_start timer%timer_start program~test15->proc~timer_start proc~timer_stop timer%timer_stop program~test15->proc~timer_stop proc~timer_write timer%timer_write program~test15->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
type(unit_test) :: ut

Source Code

program test15

   use kinds
   use fortime
   use forunittest

   implicit none

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


   ! Elapsed time with nloops
   call t%timer_start()
   do nl = 1, nloops
      call sleep(1) ! Perform operations ntimes
   end do
   call t%timer_stop(message = 'Elapsed time:', print=.false.)
   call t%timer_write('test/test15_etimes.txt') ! Optionally, write the elapsed time to a file

   call ut%check(res=t%elapsed_time, expected=real(nloops,rk)*1.0_rk, tol=1.0e-1_rk, msg='test15')

end program test15