timer Derived Type

type, public :: timer


Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: cpu_time
real(kind=rk), public :: elapsed_dtime
real(kind=rk), public :: elapsed_time
integer, private :: clock_accum_paused = 0
integer, private :: clock_elapsed
integer, private :: clock_end
integer, private :: clock_pause
integer, private :: clock_rate
integer, private :: clock_start
real(kind=rk), private :: cpu_elapsed
real(kind=rk), private :: cpu_end
real(kind=rk), private :: cpu_start
logical, private :: is_paused = .false.
logical, private :: is_started = .false.
integer, private :: values_elapsed(8)
integer, private :: values_end(8)
integer, private :: values_start(8)

Type-Bound Procedures

procedure, public :: ctimer_start

  • private impure subroutine ctimer_start(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Starts the timer by recording the current CPU time value. This value is used to calculate the CPU time later.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this

procedure, public :: ctimer_stop

  • private impure subroutine ctimer_stop(this, nloops, message, print, color, rfmt)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Stops the timer and calculates the CPU time. Optionally, it can print a message along with the CPU time.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this
    integer, intent(in), optional :: nloops
    character(len=*), intent(in), optional :: message
    logical, intent(in), optional :: print
    character(len=*), intent(in), optional :: color
    character(len=*), intent(in), optional :: rfmt

procedure, public :: ctimer_write

  • private impure subroutine ctimer_write(this, file_name)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Writes the CPU time to a file.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(in) :: this
    character(len=*), intent(in) :: file_name

procedure, public :: dtimer_start

  • private impure subroutine dtimer_start(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Starts the timer by recording the current processor clock value. This value is used to calculate the elapsed time later.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this

procedure, public :: dtimer_stop

  • private impure subroutine dtimer_stop(this, nloops, message, print, color, rfmt)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Stops the timer and calculates the elapsed time. Optionally, it can print a message along with the elapsed time.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this
    integer, intent(in), optional :: nloops
    character(len=*), intent(in), optional :: message
    logical, intent(in), optional :: print
    character(len=*), intent(in), optional :: color
    character(len=*), intent(in), optional :: rfmt

procedure, public :: dtimer_write

  • private impure subroutine dtimer_write(this, file_name)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Writes the elapsed time to a file.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(in) :: this
    character(len=*), intent(in) :: file_name

procedure, public :: timer_pause

  • private impure subroutine timer_pause(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this

procedure, public :: timer_resume

  • private impure subroutine timer_resume(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this

procedure, public :: timer_start

  • private impure subroutine timer_start(this)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Starts the timer by recording the current processor clock value. This value is used to calculate the elapsed time later.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this

procedure, public :: timer_stop

  • private impure subroutine timer_stop(this, nloops, message, print, color, rfmt)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Stops the timer and calculates the elapsed time. Optionally, it can print a message along with the elapsed time.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(inout) :: this
    integer, intent(in), optional :: nloops
    character(len=*), intent(in), optional :: message
    logical, intent(in), optional :: print
    character(len=*), intent(in), optional :: color
    character(len=*), intent(in), optional :: rfmt

procedure, public :: timer_write

  • private impure subroutine timer_write(this, file_name)

    Author
    Seyed Ali Ghasemi
    License
    BSD 3-Clause

    Writes the elapsed time to a file.

    Arguments

    Type IntentOptional Attributes Name
    class(timer), intent(in) :: this
    character(len=*), intent(in) :: file_name