test31 Program

Uses

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

Calls

program~~test31~~CallsGraph program~test31 test31 check check program~test31->check proc~timer_pause timer%timer_pause program~test31->proc~timer_pause proc~timer_resume timer%timer_resume program~test31->proc~timer_resume proc~timer_start timer%timer_start program~test31->proc~timer_start proc~timer_stop timer%timer_stop program~test31->proc~timer_stop proc~print_time print_time proc~timer_stop->proc~print_time colorize colorize proc~print_time->colorize

Variables

Type Attributes Name Initial
type(timer) :: t
type(unit_test) :: ut

Source Code

program test31

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

   implicit none

   type(timer) :: t
   type(unit_test) :: ut


   ! Elapsed time
   call t%timer_start()
      call sleep(1) ! Perform operations here
   call t%timer_pause()
      call sleep(1) ! Pause operations here
   call t%timer_resume()
      call sleep(1) ! Perform operations here
   call t%timer_stop()

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

end program test31