Loading...
Searching...
No Matches
benchmark_timer

Definition

Returns the actual time in milliseconds.

Examples

The following example uses the benchmark_timer::clock subroutine to get the actual time in milliseconds.

use benchmark_timer
real(r8) :: time
call clock(time)
write(*,*) 'The actual time is ', time, ' ms.'

Remarks

The system clock that is used can be modified. Three options are available at the moment: CPUTIME, DATETIME, SYSTEMTIME. They corresponds to the underlying functions cpu_time, date_and_time and system_clock, respectively.

Enums

CLOCK_ENUM

enumerator cputime = 0
 Value related to the function cpu_time
 
enumerator datetime = 1
 Value related to the function date_and_time
 
enumerator systemtime = 2
 Value related to the function system_clock
 

Methods

◆ clock()

subroutine, public clock ( real(r8), intent(inout) r,
integer(clock_enum), intent(in), optional option )

Returns the actual time in milliseconds.

Parameters
[in,out]rThe parameter containing the clock time in milliseconds
[in]option(optional) Clock type.

Remarks

Possible values are

  • CPUTIME
  • DATETIME
  • SYSTEMTIME

Definition at line 51 of file Timer.f90.