Manual Reference Pages  - system_cpu_time (3m_system)

NAME

system_cpu_time(3f) - [M_system] get processor time by calling times(3c) (LICENSE:PD)

CONTENTS

Synopsis
Description
Output
Errors
Examples

SYNOPSIS

subroutine system_cpu_time(c_user, c_system, c_total)

     real,intent(out) :: c_total
     real,intent(out) :: c_user
     real,intent(out) :: c_system

DESCRIPTION

Calls the C times(3c) procedure and returns the total processor time in seconds as well as the two times contributing to it (user time and system time).

OUTPUT

c_total
  total processor time ( c_user + c_system )
c_user processor user time
c_system
  processor system time

ERRORS

No errors are defined.

EXAMPLES

Sample program:

   program demo_system_cpu_time

use M_system, only : system_cpu_time use ISO_C_BINDING, only : c_float implicit none real :: user_start, system_start, total_start real :: user_finish, system_finish, total_finish integer :: i integer :: itimes=1000000 real :: value

call system_cpu_time(total_start,user_start,system_start)

value=0.0 do i=1,itimes value=sqrt(real(i)+value) enddo write(10,*)value flush(10) write(*,*)’average sqrt value=’,value/itimes call system_cpu_time(total_finish,user_finish,system_finish) write(*,*)’USER ......’,user_finish-user_start write(*,*)’SYSTEM ....’,system_finish-system_start write(*,*)’TOTAL .....’,total_finish-total_start

end program demo_system_cpu_time

Typical Results:


Nemo Release 3.1 system_cpu_time (3m_system) March 07, 2025
Generated by manServer 1.08 from 21509b3b-17bd-4c9f-be5f-ae84c993f79b using man macros.