Setup a new timer object, reset the values and give it a label for later identification
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_labeledtimer_type), | intent(inout), | optional | :: | me |
timer object |
|
character(len=*), | intent(in) | :: | timerName |
Name for this timer |
||
integer, | intent(out) | :: | timerHandle |
A handle to reference this timer |
subroutine tem_addTimer( me, timerName, timerHandle )
! -------------------------------------------------------------------- !
!> timer object
type(tem_labeledtimer_type), intent(inout), optional :: me
!> Name for this timer
character(len=*), intent(in) :: timerName
!> A handle to reference this timer
integer, intent(out) :: timerHandle
! -------------------------------------------------------------------- !
logical :: is_newtimer
! -------------------------------------------------------------------- !
if ( present(me) ) then
call append( me = me%label, &
& val = trim(timerName), &
& pos = timerHandle, &
& wasAdded = is_newtimer )
if (is_newtimer) then
call tem_appendTimers( me = me%timedat, &
& nVals = 1 )
end if
else
call append( me = timer%label, &
& val = trim(timerName), &
& pos = timerHandle, &
& wasAdded = is_newtimer )
if (is_newtimer) then
call tem_appendTimers( me = timer%timedat, &
& nVals = 1 )
end if
end if
end subroutine tem_addTimer