test2 Program

Uses

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

Calls

program~~test2~~CallsGraph program~test2 test2 check check program~test2->check proc~timer_start timer%timer_start program~test2->proc~timer_start proc~timer_stop timer%timer_stop program~test2->proc~timer_stop proc~timer_write timer%timer_write program~test2->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 test2

   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(nloops = nloops, message = 'Elapsed time:')
   call t%timer_write('test/test2_etimes.txt') ! Optionally, write the elapsed time to a file

   call ut%check(res=t%elapsed_time, expected=1.0_rk, tol=1.0e-1_rk, msg='test2')

end program test2