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:: SYSTEM_CLOCK, time, clock ticks, clock ticks
10 SYSTEM_CLOCK --- Time function
11 ******************************
13 .. function:: SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX)
15 Determines the :samp:`{COUNT}` of a processor clock since an unspecified
16 time in the past modulo :samp:`{COUNT_MAX}`, :samp:`{COUNT_RATE}` determines
17 the number of clock ticks per second. If the platform supports a
18 monotonic clock, that clock is used and can, depending on the platform
19 clock implementation, provide up to nanosecond resolution. If a
20 monotonic clock is not available, the implementation falls back to a
24 (Optional) shall be a scalar of type
25 ``INTEGER`` with ``INTENT(OUT)``.
28 (Optional) shall be a scalar of type
29 ``INTEGER`` or ``REAL``, with ``INTENT(OUT)``.
32 (Optional) shall be a scalar of type
33 ``INTEGER`` with ``INTENT(OUT)``.
42 .. code-block:: fortran
44 CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])
47 .. code-block:: fortran
49 PROGRAM test_system_clock
50 INTEGER :: count, count_rate, count_max
51 CALL SYSTEM_CLOCK(count, count_rate, count_max)
52 WRITE(*,*) count, count_rate, count_max