PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/share/doc/gfortran/ETIME.html

https://gitlab.com/infected_/linaro_aarch64-linux-android-5.3.x
HTML | 171 lines | 110 code | 15 blank | 46 comment | 0 complexity | d1ddfebc2b2e831ea09cb2abd7919eb4 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1999-2015 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>The GNU Fortran Compiler: ETIME</title>
  20. <meta name="description" content="The GNU Fortran Compiler: ETIME">
  21. <meta name="keywords" content="The GNU Fortran Compiler: ETIME">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Intrinsic-Procedures.html#Intrinsic-Procedures" rel="up" title="Intrinsic Procedures">
  30. <link href="EXECUTE_005fCOMMAND_005fLINE.html#EXECUTE_005fCOMMAND_005fLINE" rel="next" title="EXECUTE_COMMAND_LINE">
  31. <link href="ERFC_005fSCALED.html#ERFC_005fSCALED" rel="prev" title="ERFC_SCALED">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="ETIME"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="EXECUTE_005fCOMMAND_005fLINE.html#EXECUTE_005fCOMMAND_005fLINE" accesskey="n" rel="next">EXECUTE_COMMAND_LINE</a>, Previous: <a href="ERFC_005fSCALED.html#ERFC_005fSCALED" accesskey="p" rel="prev">ERFC_SCALED</a>, Up: <a href="Intrinsic-Procedures.html#Intrinsic-Procedures" accesskey="u" rel="up">Intrinsic Procedures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="ETIME-_002d_002d_002d-Execution-time-subroutine-_0028or-function_0029"></a>
  69. <h3 class="section">9.91 <code>ETIME</code> &mdash; Execution time subroutine (or function)</h3>
  70. <a name="index-ETIME"></a>
  71. <a name="index-time_002c-elapsed-2"></a>
  72. <dl compact="compact">
  73. <dt><em>Description</em>:</dt>
  74. <dd><p><code>ETIME(VALUES, TIME)</code> returns the number of seconds of runtime
  75. since the start of the process&rsquo;s execution in <var>TIME</var>. <var>VALUES</var>
  76. returns the user and system components of this time in <code>VALUES(1)</code> and
  77. <code>VALUES(2)</code> respectively. <var>TIME</var> is equal to <code>VALUES(1) + VALUES(2)</code>.
  78. </p>
  79. <p>On some systems, the underlying timings are represented using types with
  80. sufficiently small limits that overflows (wrap around) are possible, such as
  81. 32-bit types. Therefore, the values returned by this intrinsic might be, or
  82. become, negative, or numerically less than previous values, during a single
  83. run of the compiled program.
  84. </p>
  85. <p>This intrinsic is provided in both subroutine and function forms; however,
  86. only one form can be used in any given program unit.
  87. </p>
  88. <p><var>VALUES</var> and <var>TIME</var> are <code>INTENT(OUT)</code> and provide the following:
  89. </p>
  90. <table>
  91. <tr><td width="15%"></td><td width="30%"><code>VALUES(1)</code>:</td><td width="60%">User time in seconds.</td></tr>
  92. <tr><td width="15%"></td><td width="30%"><code>VALUES(2)</code>:</td><td width="60%">System time in seconds.</td></tr>
  93. <tr><td width="15%"></td><td width="30%"><code>TIME</code>:</td><td width="60%">Run time since start in seconds.</td></tr>
  94. </table>
  95. </dd>
  96. <dt><em>Standard</em>:</dt>
  97. <dd><p>GNU extension
  98. </p>
  99. </dd>
  100. <dt><em>Class</em>:</dt>
  101. <dd><p>Subroutine, function
  102. </p>
  103. </dd>
  104. <dt><em>Syntax</em>:</dt>
  105. <dd><table>
  106. <tr><td width="80%"><code>CALL ETIME(VALUES, TIME)</code>.</td></tr>
  107. <tr><td width="80%"><code>TIME = ETIME(VALUES)</code>, (not recommended).</td></tr>
  108. </table>
  109. </dd>
  110. <dt><em>Arguments</em>:</dt>
  111. <dd><table>
  112. <tr><td width="15%"><var>VALUES</var></td><td width="70%">The type shall be <code>REAL(4), DIMENSION(2)</code>.</td></tr>
  113. <tr><td width="15%"><var>TIME</var></td><td width="70%">The type shall be <code>REAL(4)</code>.</td></tr>
  114. </table>
  115. </dd>
  116. <dt><em>Return value</em>:</dt>
  117. <dd><p>Elapsed time in seconds since the start of program execution.
  118. </p>
  119. </dd>
  120. <dt><em>Example</em>:</dt>
  121. <dd><div class="smallexample">
  122. <pre class="smallexample">program test_etime
  123. integer(8) :: i, j
  124. real, dimension(2) :: tarray
  125. real :: result
  126. call ETIME(tarray, result)
  127. print *, result
  128. print *, tarray(1)
  129. print *, tarray(2)
  130. do i=1,100000000 ! Just a delay
  131. j = i * i - i
  132. end do
  133. call ETIME(tarray, result)
  134. print *, result
  135. print *, tarray(1)
  136. print *, tarray(2)
  137. end program test_etime
  138. </pre></div>
  139. </dd>
  140. <dt><em>See also</em>:</dt>
  141. <dd><p><a href="CPU_005fTIME.html#CPU_005fTIME">CPU_TIME</a>
  142. </p>
  143. </dd>
  144. </dl>
  145. <hr>
  146. <div class="header">
  147. <p>
  148. Next: <a href="EXECUTE_005fCOMMAND_005fLINE.html#EXECUTE_005fCOMMAND_005fLINE" accesskey="n" rel="next">EXECUTE_COMMAND_LINE</a>, Previous: <a href="ERFC_005fSCALED.html#ERFC_005fSCALED" accesskey="p" rel="prev">ERFC_SCALED</a>, Up: <a href="Intrinsic-Procedures.html#Intrinsic-Procedures" accesskey="u" rel="up">Intrinsic Procedures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  149. </div>
  150. </body>
  151. </html>