Timer class storing all function calls
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(mimic_stack_entry), | private, | dimension(:), pointer | :: | entries | List of top-level function calls |
||
integer, | private | :: | num_entries | = | 0 | Number of entries |
Start a timer for a given function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_timer), | intent(inout), | target | :: | this | ||
type(mimic_stack_entry), | intent(inout), | pointer | :: | parent | pointer to parent stack entry |
|
character(len=*), | intent(in) | :: | name | name of the procedure |
Pointer to a created stack entry
Stop a timer for a given function (invalidates the pointer)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_timer), | intent(inout), | target | :: | this | ||
type(mimic_stack_entry), | intent(inout), | pointer | :: | entry | Function timing of which is currently measured |
Print measured timings of function calls
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_timer), | intent(inout) | :: | this |
type :: mimic_timer
private
!> List of top-level function calls
type(mimic_stack_entry), dimension(:), pointer :: entries
!> Number of entries
integer :: num_entries = 0
contains
private
procedure :: start => start_timer
procedure :: stop => stop_timer
procedure :: print => print_timings
end type mimic_timer