Prints the elapsed time at the time of calling
Usage: call my_timer%print_time()
Needs my_timer to be declared previously as type(pic_timer_type) :: my_timer
This function does not stop the timer, it will get the current time elapsed stopped or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pic_timer_type), | intent(in) | :: | self |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=dp), | private | :: | elapsed |
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(pic_timer_type) :: my_timer !! !! This function does not stop the timer, it will get the current time elapsed stopped or not class(pic_timer_type), intent(in) :: self real(dp) :: elapsed elapsed = self%get_elapsed_time() if (self%is_running) then print *, "Currently elapsed time: "//to_string(elapsed)//" seconds" else print *, "Elapsed time: "//to_string(elapsed)//" seconds" end if end subroutine timer_print_time