2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: ETIME, time, elapsed
10 ETIME --- Execution time subroutine (or function)
11 *************************************************
13 .. function:: ETIME(VALUES, TIME)
15 ``ETIME(VALUES, TIME)`` returns the number of seconds of runtime
16 since the start of the process's execution in :samp:`{TIME}`. :samp:`{VALUES}`
17 returns the user and system components of this time in ``VALUES(1)`` and
18 ``VALUES(2)`` respectively. :samp:`{TIME}` is equal to ``VALUES(1) + VALUES(2)``.
21 The type shall be ``REAL(4), DIMENSION(2)``.
24 The type shall be ``REAL(4)``.
27 Elapsed time in seconds since the start of program execution.
36 .. code-block:: fortran
38 CALL ETIME(VALUES, TIME).
39 TIME = ETIME(VALUES), (not recommended).
42 .. code-block:: fortran
46 real, dimension(2) :: tarray
48 call ETIME(tarray, result)
52 do i=1,100000000 ! Just a delay
55 call ETIME(tarray, result)
59 end program test_etime