12 real(kind=double) :: wct
14 real(kind=double) :: usr
16 real(kind=double) :: cumwct
18 real(kind=double) :: cumusr
22 character(len=15) :: status
45 class(
tim),
intent(out) :: this
58 class(
tim),
intent(inout) :: this
60 this%status =
'destroy'
76 subroutine tim_print(this, lun, add_msg, add_msg1, add_msg2)
78 class(
tim),
intent(in) :: this
79 integer,
intent(in) :: lun
80 character(len=*),
optional,
intent(in) :: add_msg, add_msg1, add_msg2
82 character(len=256) :: msg, msg1, msg2
84 if (
present(add_msg))
then
90 if (
present(add_msg1))
then
96 if (
present(add_msg2))
then
102 write (lun,
'(a,f7.3,a,f7.3,a)') trim(msg)//
' WCT: ', this%CUMwct, &
103 ' (s) '//trim(msg1)//
'; USR: ', this%CUMusr,
' (s) '//trim(msg2)
120 class(
tim),
intent(inout) :: this
121 character(len=*),
optional,
intent(in) :: code
123 real(kind=double) :: time
124 integer :: itime, tick_per_sec
125 character(len=3) :: com
127 call system_clock(itime, tick_per_sec)
129 if (
present(code))
then
132 select case (this%status(1:3))
144 call cpu_time(this%usr)
145 call system_clock(itime)
146 this%wct = dble(itime)/dble(tick_per_sec)
151 this%usr = time - this%usr
152 call system_clock(itime)
153 this%wct = dble(itime)/dble(tick_per_sec) - this%wct
154 this%CUMusr = this%CUMusr + this%usr
155 this%CUMwct = this%CUMwct + this%wct
Defines vars and procs for cpu timing of code sections.
subroutine tim_print(this, lun, add_msg, add_msg1, add_msg2)
Info procedure (public procedure for type timing::tim).
subroutine tim_construct(this)
Static constructor (procedure public for type timing::tim).
subroutine tim_set(this, code)
Set procedure (public procedure for type timing::tim). Sets the values of var of type timing::tim.
subroutine tim_destroy(this)
Static destructor (procedure public for type timing::tim).