test26 Program

Uses

  • program~~test26~~UsesGraph program~test26 test26 forunittest forunittest program~test26->forunittest module~fortime fortime program~test26->module~fortime iso_fortran_env iso_fortran_env module~fortime->iso_fortran_env

Calls

program~~test26~~CallsGraph program~test26 test26 check check program~test26->check proc~dtimer_start timer%dtimer_start program~test26->proc~dtimer_start proc~dtimer_stop timer%dtimer_stop program~test26->proc~dtimer_stop proc~dtimer_write timer%dtimer_write program~test26->proc~dtimer_write proc~print_time print_time proc~dtimer_stop->proc~print_time proc~to_seconds to_seconds proc~dtimer_stop->proc~to_seconds proc~write_to_file write_to_file proc~dtimer_write->proc~write_to_file 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 test26

   use fortime, only: timer
   use forunittest, only: unit_test, rk

   implicit none

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


   ! Elapsed time with nloops
   call t%dtimer_start()
   do nl = 1, nloops
      call sleep(1) ! Perform operations ntimes
   end do
   call t%dtimer_stop(nloops = nloops, message = 'Elapsed time:')
   call t%dtimer_write('test/test26_etimes.txt') ! Optionally, write the elapsed time to a file

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

end program test26