timer_print_time Subroutine

private subroutine timer_print_time(self)

Prints the elapsed time at the time of calling

Usage: call my_timer%print_time()

Needs my_timer to be declared previously as type(timer_type) :: my_timer

This function does not stop the timer, it will get the current time elapsed stopped or not

Type Bound

timer_type

Arguments

Type IntentOptional Attributes Name
class(timer_type), intent(in) :: self

Calls

proc~~timer_print_time~~CallsGraph proc~timer_print_time timer_type%timer_print_time interface~to_char to_char proc~timer_print_time->interface~to_char proc~timer_get_elapsed_time timer_type%timer_get_elapsed_time proc~timer_print_time->proc~timer_get_elapsed_time proc~to_char_char to_char_char interface~to_char->proc~to_char_char proc~to_char_dp to_char_dp interface~to_char->proc~to_char_dp proc~to_char_int32 to_char_int32 interface~to_char->proc~to_char_int32 proc~to_char_int64 to_char_int64 interface~to_char->proc~to_char_int64 proc~to_char_logical to_char_logical interface~to_char->proc~to_char_logical proc~to_char_matrix_dp to_char_matrix_dp interface~to_char->proc~to_char_matrix_dp proc~to_char_matrix_int32 to_char_matrix_int32 interface~to_char->proc~to_char_matrix_int32 proc~to_char_matrix_int64 to_char_matrix_int64 interface~to_char->proc~to_char_matrix_int64 proc~to_char_matrix_sp to_char_matrix_sp interface~to_char->proc~to_char_matrix_sp proc~to_char_sp to_char_sp interface~to_char->proc~to_char_sp proc~to_char_vector_dp to_char_vector_dp interface~to_char->proc~to_char_vector_dp proc~to_char_vector_int32 to_char_vector_int32 interface~to_char->proc~to_char_vector_int32 proc~to_char_vector_int64 to_char_vector_int64 interface~to_char->proc~to_char_vector_int64 proc~to_char_vector_sp to_char_vector_sp interface~to_char->proc~to_char_vector_sp

Variables

Type Visibility Attributes Name Initial
real(kind=dp), private :: elapsed

Source Code

   subroutine timer_print_time(self)
      !! Prints the elapsed time at the time of calling
      !!
      !! Usage: call my_timer%print_time()
      !!
      !! Needs my_timer to be declared previously as type(timer_type) :: my_timer
      !!
      !! This function does not stop the timer, it will get the current time elapsed stopped or not
      class(timer_type), intent(in) :: self
      real(dp) :: elapsed

      elapsed = self%get_elapsed_time()
      if (self%is_running) then
         print *, "Currently elapsed time: "//to_char(elapsed)//" seconds"
      else
         print *, "Elapsed time: "//to_char(elapsed)//" seconds"
      end if
   end subroutine timer_print_time