Commit a30087ec authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Encapsulate and some cleanup

Make only timer_t visible via the module, some cleanup
parent 10f677a0
......@@ -3,16 +3,17 @@ module ftimings
implicit none
save
public
public timer_t
private
integer, parameter, private :: name_length = 32
integer, parameter, private :: rk = C_DOUBLE
interface
function microseconds_since_epoch() result(ms) bind(C, name="microseconds_since_epoch")
function microseconds_since_epoch() result(us) bind(C, name="microseconds_since_epoch")
use, intrinsic :: iso_c_binding
implicit none
integer(kind=C_INT64_T) :: ms
integer(kind=C_INT64_T) :: us
end function
end interface
......@@ -37,6 +38,7 @@ module ftimings
end type
type timer_t
private
logical :: active = .false.
type(node_t), pointer :: root => NULL()
type(node_t), pointer :: current_node => NULL()
......@@ -147,7 +149,7 @@ module ftimings
function node_sum_of_children(self) result(sum_time)
class(node_t), intent(in) :: self
type(node_t), pointer :: cur_entry
integer(kind=C_INT64_T) :: sum_time, child_time
integer(kind=C_INT64_T) :: sum_time
sum_time = 0
cur_entry => self%firstChild
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment