contains a simple timer module to measure and record time
derived type for a timer, contains the start, stop, and count variables can work with or without omp. If PIC is compiled with OpenMP the default timer will be the omp time. This is mostly to minimize problems with threading and system clock
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | count_rate | = | 1_default_int | ||
| logical, | private | :: | is_running | = | .false. | ||
| integer(kind=default_int), | private | :: | start_count | = | 0_default_int | ||
| real(kind=dp), | private | :: | start_time | = | 0.0_dp | ||
| integer(kind=default_int), | private | :: | stop_count | = | 0_default_int | ||
| real(kind=dp), | private | :: | stop_time | = | 0.0_dp | ||
| real(kind=dp), | private | :: | walltime |
| procedure, public, non_overridable :: get_elapsed_time => timer_get_elapsed_time | |
| procedure, public, non_overridable :: print_time => timer_print_time | |
| procedure, public, non_overridable :: start => timer_start | |
| procedure, public, non_overridable :: stop => timer_stop |
Returns the elapsed time as a real(dp) variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_type), | intent(in) | :: | self |
Prints the elapsed time at the time of calling
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_type), | intent(in) | :: | self |
starts the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_type), | intent(inout) | :: | self |
stop the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_type), | intent(inout) | :: | self |