Get accumulated time for a named region
Returns 0.0 if the region does not exist.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | idx |
function profiler_get_time(name) result(t) !! Get accumulated time for a named region !! !! Returns 0.0 if the region does not exist. character(len=*), intent(in) :: name real(dp) :: t integer(default_int) :: idx t = 0.0_dp #ifdef PIC_DISABLE_PROFILER return #endif do idx = 1, state%num_regions if (trim(state%regions(idx)%name) == trim(name)) then t = state%regions(idx)%total_time return end if end do end function profiler_get_time